Home | All Classes | Main Classes | Annotated | Grouped Classes | Functions | ![]() |
The QComboTableItem class provides a means of using comboboxes in QTables. More...
#include <QComboTableItem>
This class is part of the Qt 3 compatibility library. It is provided to keep old source code working. We strongly advise against using it in new code.
Inherits QTableItem.
The QComboTableItem class provides a means of using comboboxes in QTables.
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. Pixmaps may not 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 can 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, and QComboBox.
Creates a combo table item for the table table. The combobox's list of items is passed in the list argument. If editable is true the user may type in new list items; if editable is false the user may only select from the list of items provided.
By default QComboTableItems cannot be replaced by other table items since isReplaceable() returns false.
See also QTable::clearCell() and EditType.
QComboTableItem destructor.
Returns the total number of list items in the combo table item.
Returns the index of the combo table item's current list item.
See also setCurrentItem().
Returns the text of the combo table item's current list item.
See also currentItem() and text().
Returns true if the user can add their own list items to the combobox's list of items; otherwise returns false.
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, to allow for extensions to this class.
Reimplemented from QTableItem.
See also QTableItem::rtti().
Sets list item i to be the combo table item's current list item.
See also currentItem().
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
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().
If b is true the combo table item can be edited, i.e. the user can enter a new text item themselves. If b is false the user can only choose one of the existing items.
See also isEditable().
Sets the QComboTableItem's list of items to the strings in the string list l.
Returns the text of the combo's list item at index i.
See also currentText().
Copyright © 2004 Trolltech. | Trademarks | Qt 4.0.0-tp2 |