The QComboBox widget is a combined button and popup list. More...
#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 text or 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).
Examples: tictac/tictac.cpp qmag/qmag.cpp widgets/widgets.cpp
Constructs a combo box widget with a parent and a name.
Destroys the combo box.
[signal]
This signal is emitted when a new item has been activated (selected). The index is the position of the item in the popup list.
Returns TRUE if auto-resizing is enabled, or FALSE if auto-resizing is disabled.
Auto-resizing is disabled by default.
See also: setAutoResize().
Replaces the item at position index with a pixmap.
Replaces the item at position index with a text.
Removes all combo box items.
Returns the number of items in the combo box.
Returns the current combo box item.
See also: setCurrentItem().
[signal]
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 pixmap item at position index. The item will be appended if index is negative.
Inserts a text item at position index. The item will be appended if index is negative.
Examples: widgets/widgets.cpp
Inserts the list of strings at the index index in the combo box.
Examples: qmag/qmag.cpp
Inserts the array of strings at the index index in the combo box.
The numStrings argument is the number of strings. If numStrings is -1 (default), the strs array must be terminated with 0.
Example:
static const char *items[] = { "red", "green", "blue", 0 }; combo->insertStrList( items );
[virtual protected]
Handles key press events for the combo box. Only Enter and Return are accepted.
Reimplemented from QWidget.
[virtual protected]
Handles mouse double click events for the combo box.
Reimplemented from QWidget.
[virtual protected]
Handles mouse move events for the combo box.
Reimplemented from QWidget.
[virtual protected]
Handles mouse press events for the combo box.
Reimplemented from QWidget.
[virtual protected]
Handles mouse release events for the combo box.
Reimplemented from QWidget.
[virtual protected]
Handles paint events for the combo box.
Reimplemented from QWidget.
Returns the pixmap item at a given index, or 0 if the item is not a pixmap.
[protected]
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: autoResize() and adjustSize().
Examples: widgets/widgets.cpp
[virtual]
Reimplements QWidget::setBackgroundColor().
Sets the background color for both the combo box button and the combo box popup list.
Reimplemented from QWidget.
Sets the current combo box item. This is the item to be displayed on the combo box button.
See also: currentItem().
[virtual]
Reimplements QWidget::setFont().
Sets the font for both the combo box button and the combo box popup list.
Reimplemented from QWidget.
[virtual]
Reimplements QWidget::setPalette().
Sets the palette for both the combo box button and the combo box popup list.
Reimplemented from QWidget.
[virtual]
Returns a size which fits the contents of the combo box button.
Reimplemented from QWidget.
Returns the text item at a given index, or 0 if the item is not a string.
This file is part of the Qt toolkit, copyright © 1995-96 Troll Tech, all rights reserved.
It was generated from the following files: