Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0
Wiki Markup
{alias:qinsertitem}
h2. Name

*qinsertitem* — insert item in a QComboBox

h2. Syntax
{panel:|borderStyle=solid|borderWidth=1|bgColor=#FFFFAA}

*qinsertitem* _combo index item_ 

*qinsertitem* _combo index icon item_ 

{panel}

h2. Description

The *qinsertitem* command inserts items in a [QComboBox]. 

h2. Arguments

_combobox_
{indent}The target QComboBox. This argument is required. 
{indent}
_index_
{indent}The position in the existing item list into which the new item will be inserted (Indexing starts at 0). 
{indent}
_item_
{indent}Item value to be inserted in the combobox. This is usually a string or a number, although any Tcl variable that can be converted to a string can be used. 
{indent}
_icon_ 
{indent}An instance of a QIcon. If this argument is provided an icon will appear alongside the item. 
{indent} 

h2. Examples

h3. Ex.1: qinsertitem
{anchor:qinsertitem}

{noformat:|borderWidth=1|bgColor=#eeeeee}

Name

qinsertitem — insert item in a QComboBox

Syntax

Panel
bgColor#FFFFAA
borderWidth1
borderStylesolid

qinsertitem combo index item

qinsertitem combo index icon item

Description

The qinsertitem command inserts items in a QComboBox.

Arguments

combobox

index

item

icon

Examples

Ex.1: qinsertitem

Anchor
qinsertitem
qinsertitem

No Format
bgColor#eeeeee
borderWidth1
# Some files containing pixmaps
set fileopen_icon_file [file join $Geocap::geocapdir icons fileopen.xpm]

# Create icons
set fileopen_icon [qicon $fileopen_icon_file]

set w [qwidget ]
qsetwindowtitle "ABC Combo"
qvboxlayout {
	set c [qcombobox]
	qadditems { A B C }
	qinsertitem $c 1 INSERTED
	qinsertitem $c 2 $fileopen_icon FILEOPEN
}

qshow $w

{noformat}

!att:_img_cmd^qinsertitem.png!

The above example inserts two items, one includes an icon. Both are in a combobox. 

{pagebreak}

Image Added

The above example inserts two items, one includes an icon. Both are in a combobox.