The QComboBox widget is a combined button and popup list. (details) (complete member list)
#include <qcombo.h>
Inherits QWidget.
A combo box is a kind of popup menu that is opened by pressing a button. The popup list contains a number of string/pixmap items. The button displays the current item when the popup list is closed.
A combo box emits two signals, activated() and highlighted(), when a new item has been activated (selected) or highlighted (set to current).
Constructs a combo box widget with a parent and a name.
Destroys the combo box.
This signal is emitted when a new item has been activated (selected). The index is the position of the item in the popup list.
Adjusts the size of the combo box button to fit the contents.
This function is called automatically whenever the current item change and auto-resizing is enabled.
See also: setAutoResizing().
Returns TRUE if auto-resizing is enabled, or FALSE if auto-resizing is disabled.
Auto-resizing is disabled by default.
See also: setAutoResizing().
Replaces the item at position index with a string.
Replaces the item at position index with a pixmap.
Removes all combo box items.
Returns the number of items in the combo box.
.
This signal is emitted when a new item has been set to current. The index is the position of the item in the popup list.
Inserts a string item at position index. The item will be appended if index is negative.
Inserts a pixmap item at position index. The item will be appended if index is negative.
.
.
Returns the pixmap item at a given index, or 0 if the item is not a pixmap.
Popups the combo box popup list.
.
Removes the item at position index.
Enables auto-resizing if enable is TRUE, or disables it if enable is FALSE.
When auto-resizing is enabled, the combo box button will resize itself whenever the current combo box item change.
See also: autoResizing() and adjustSize().
Reimplements the virtual function QWidget::setBackgroundColor().
Sets the background color for both the combo box button and the combo box popup list.
Sets current item, i.e. the item to be displayed on the combo box button.
Reimplementes the virtual function QWidget::setFont().
Sets the font for both the combo box button and the combo box popup list.
Reimplementes the virtual function QWidget::setPalette().
Sets the palette for both the combo box button and the combo box popup list.
Sets the contents of the combo box to the list of strings list.
Sets the contents of the combo box to the array of strings strs.
The numStrings argument is the number of strings. If numStrings is -1 (default), the strs array must be terminated with 0.
Example of use:
static const char *items[] = { "red", "green", "blue", 0 };
combo->setStrList( items );
Returns the string item at a given index, or 0 if the item is not a string.
This file is part of the Qt toolkit, copyright 1995 Troll Tech, all rights reserved.
It was generated from the following files: