Home | All Classes | Main Classes | Annotated | Grouped Classes | Functions |
The QComboTableItem class provides a means of using comboboxes in QTables. More...
#include <qtable.h>
Inherits QTableItem.
A QComboTableItem is a table item which looks and behaves like a combobox. The advantage of using QComboTableItems rather than real comboboxes is that a QComboTableItem uses far less resources than real comboboxes in QTables. When the cell has the focus it displays a real combobox which the user can interact with. When the cell does not have the focus the cell looks like a combobox. Only text items (i.e. no pixmaps) may be used in QComboTableItems.
QComboTableItem items have the edit type WhenCurrent (see EditType). The QComboTableItem's list of items is provided by a QStringList passed to the constructor.
The list of items may be changed using setStringList(). The current item can be set with setCurrentItem() and retrieved with currentItem(). The text of the current item can be obtained with currentText(), and the text of a particular item can be retrieved with text().
If isEditable() is TRUE the QComboTableItem will permit the user to either choose an existing list item, or create a new list item by entering their own text; otherwise the user may only choose one of the existing list items.
To populate a table cell with a QComboTableItem use QTable::setItem().
QComboTableItems may be deleted with QTable::clearCell().
QComboTableItems can be distinguished from QTableItems and QCheckTableItems using their Run Time Type Identification number (see rtti()).
See also QCheckTableItem, QTableItem, QComboBox, and Advanced Widgets.
By default QComboTableItems cannot be replaced by other table items since isReplaceable() returns FALSE by default.
See also QTable::clearCell() and EditType.
See also setCurrentItem().
See also currentItem() and text().
See also setEditable().
Returns 1.
Make your derived classes return their own values for rtti()to distinguish between different table item subclasses. You should use values greater than 1000, preferably a large random number, to allow for extensions to this class.
See also QTableItem::rtti().
Reimplemented from QTableItem.
See also currentItem().
Example: table/small-table-demo/main.cpp.
Sets the list item whose text is s to be the combo table item's current list item. Does nothing if no list item has the text s.
See also currentItem().
See also isEditable().
See also currentText().
This file is part of the Qt toolkit. Copyright © 1995-2003 Trolltech. All Rights Reserved.
Copyright © 2003 Trolltech | Trademarks | Qt version 3.1.2
|