Home · All Classes · Main Classes · Grouped Classes · Modules · Functions |
The QTableWidgetItem class provides an item for use with the QTableWidget class. More...
#include <QTableWidgetItem>
The QTableWidgetItem class provides an item for use with the QTableWidget class.
Table items are used to hold pieces of information for table widgets. Items usually contain text, icons, or checkboxes
The QTableWidgetItem class is a convenience class that replaces the QTableItem class in Qt 3. It provides an item for use with the QTableWidget class.
Top-level items are constructed without a parent then inserted at the position specified by a pair of row and column numbers:
QTableWidgetItem *newItem = new QTableWidgetItem(tr("%1").arg( pow(row, column+1))); tableWidget->setItem(row, column, newItem);
Each item can have its own background color which is set with the setBackgroundColor() function. The current background color can be found with backgroundColor(). The text label for each item can be rendered with its own font and text color. These are specified with the setFont() and setTextColor() functions, and read with font() and textColor().
By default, items are enabled, editable, selectable, checkable, and can be used both as the source of a drag and drop operation and as a drop target. Each item's flags can be changed by calling setFlags() with the appropriate value (see Qt::ItemFlags). Checkable items can be checked and unchecked with the setChecked() function. The corresponding checked() function indicates whether the item is currently checked.
See also QTableWidget, Model/View Programming, QListWidgetItem, and QTreeWidgetItem.
Constructs a table item of the specified type that does not belong to any table.
See also type().
Constructs a table item with the given text.
See also type().
Constructs a copy of other. Note that type() and tableWidget() are not copied.
This function is useful when reimplementing clone().
This function was introduced in Qt 4.1.
Destroys the table item.
Returns the color used to render the item's background.
See also textColor() and setBackgroundColor().
Returns the checked state of the table item.
See also setCheckState() and flags().
Creates a copy of the item.
Returns the item's data for the given role.
See also setData().
Returns the flags used to describe the item. These determine whether the item can be checked, edited, and selected.
See also setFlags().
Returns the font used to render the item's text.
See also setFont().
Returns the item's icon.
See also setIcon() and iconSize.
Reads the item from stream in.
See also write().
Sets the item's background color to the specified color.
See also backgroundColor() and setTextColor().
Sets the check state of the table item to be state.
See also checkState().
Sets the item's data for the given role to the specified value.
See also Qt::ItemDataRole and data().
Sets the flags for the item to the given flags. These determine whether the item can be selected or modified.
See also flags().
Sets the font used to display the item's text to the given font.
See also font(), setText(), and setTextColor().
Sets the item's icon to the icon specified.
See also icon(), setText(), and iconSize.
Sets the size hint for the table item to be size. If no size hint is set, the item delegate will compute the size hint based on the item data.
This function was introduced in Qt 4.1.
See also sizeHint().
Sets the item's status tip to the string specified by statusTip.
See also statusTip(), setToolTip(), and setWhatsThis().
Sets the item's text to the text specified.
See also text(), setFont(), and setTextColor().
Sets the text alignment for the item's text to the alignment specified.
See also textAlignment() and Qt::Alignment.
Sets the color used to display the item's text to the given color.
See also textColor(), setFont(), and setText().
Sets the item's tooltip to the string specified by toolTip.
See also toolTip(), setStatusTip(), and setWhatsThis().
Sets the item's "What's This?" help to the string specified by whatsThis.
See also whatsThis(), setStatusTip(), and setToolTip().
Returns the size hint set for the table item.
This function was introduced in Qt 4.1.
See also setSizeHint().
Returns the item's status tip.
See also setStatusTip().
Returns the table widget that contains the item.
Returns the item's text.
See also setText().
Returns the text alignment for the item's text.
See also setTextAlignment() and Qt::Alignment.
Returns the color used to render the item's text.
See also backgroundColor() and setTextColor().
Returns the item's tooltip.
See also setToolTip().
Returns the type passed to the QTableWidgetItem constructor.
Returns the item's "What's This?" help.
See also setWhatsThis().
Writes the item to stream out.
See also read().
Returns true if the item is less than the other item; otherwise returns false.
Assigns other's data and flags to this item. Note that type() and tableWidget() are not copied.
This function is useful when reimplementing clone().
The default type for table widget items.
The minimum value for custom types. Values below UserType are reserved by Qt.
This is an overloaded member function, provided for convenience.
Writes the table widget item item to stream out.
This operator uses QTableWidgetItem::write().
See also Format of the QDataStream Operators.
This is an overloaded member function, provided for convenience.
Reads a table widget item from stream in into item.
This operator uses QTableWidgetItem::read().
See also Format of the QDataStream Operators.
Copyright © 2006 Trolltech | Trademarks | Qt 4.1.3 |