Home | All Classes | Main Classes | Annotated | Grouped Classes | Functions | ![]() |
The QListWidgetItem class provides an item for use with the QListWidget item view class. More...
#include <QListWidgetItem>
The QListWidgetItem class provides an item for use with the QListWidget item view class.
The QListWidgetItem class provides a list item for use with the QListWidget class. List items provide label information that is displayed in list widgets.
The item view convenience classes use a classic item-based interface rather than a pure model/view approach. For a more flexible list view widget, consider using the QListView class with a standard model.
List items can be automatically inserted into a list when they are constructed by specifying the list widget:
new QListWidgetItem(tr("Hazel"), listWidget);
They can also be created without a parent widget, and later inserted into a list (see QListWidget::insertItem()).
List items are typically used to display text() and an icon(). These are set with the setText() and setIcon() functions. The appearance of the text can be customized with setFont(), setTextColor(), and setBackgroundColor(). List items can be aligned using the setAlignment() function. Tooltips, status tips and "What's This?" help can be added to list items with setToolTip(), setStatusTip(), and setWhatsThis().
Items can be made checkable by calling setFlags() with the appropriate value (see QAbstractItemModel::ItemFlags). Checkable items can be checked and unchecked with the setChecked() function. The corresponding checked() function indicates whether the item is currently checked.
The isItemHidden() function can be used to determine whether the item is hidden. Items can be hidden with setItemHidden().
See also QListWidgetItem and Model/View Programming.
Constructs an empty list widget item with the given parent. If the parent is not specified, the item will need to be inserted into a list widget with QListWidget::insertItem().
Constructs an empty list widget item with the given text and parent. If the parent is not specified, the item will need to be inserted into a list widget with QListWidget::insertItem().
Destroys the list item.
Returns the color used to display the list item's background.
See also setBackgroundColor() and textColor().
Returns the checked state of the list item (see QCheckBox::ToggleState).
Only checkable items can be checked. By default, items are not checkable.
See also flags().
Removes all list items.
This function returns the item's data for a given role (see {QAbstractItemModel::Role}). Reimplement this function if you need extra roles or special behavior for certain roles.
Returns the item flags for this item (see {QAbstractItemModel::ItemFlags}).
Returns the font used to display this list item's text.
Returns the list item's icon.
See also setIcon().
Returns the list widget that contains the item.
Sets the background color of the list item to the given color.
See also backgroundColor() and setTextColor().
Checks the list item if checked is true; otherwise the list item will be shown as unchecked.
See also checked().
This function sets the data for a given role to the given value (see QAbstractItemModel::Role). Reimplement this function if you need extra roles or special behavior for certain roles.
Sets the item flags for the list item to flags (see QAbstractItemModel::ItemFlags).
Sets the font used when painting the item to the given font.
Sets the icon for the list item to the given icon.
See also icon().
Sets the status tip for the list item to the text specified by statusTip.
See also statusTip(), setToolTip(), and setWhatsThis().
Sets the text for the list widget item's to the given text.
See also text().
Sets the list item's text alignment to alignment (see Qt::AlignmentFlag).
Sets the text color for the list item to the given color.
See also textColor() and setBackgroundColor().
Sets the tooltip for the list item to the text specified by toolTip.
See also toolTip(), setStatusTip(), and setWhatsThis().
Sets the "What's This?" help for the list item to the text specified by whatsThis.
See also whatsThis(), setStatusTip(), and setToolTip().
Returns the list item's status tip.
See also setStatusTip().
Returns the list item's text.
See also setText().
Returns the text alignment for the list item (see Qt::AlignmentFlag).
Returns the used to display the list item's text.
See also setTextColor() and backgroundColor().
Returns the list item's tooltip.
See also setToolTip(), statusTip(), and whatsThis().
Returns the list item's "What's This?" help text.
See also setWhatsThis(), statusTip(), and toolTip().
Returns true if this item's text is less then other item's text; otherwise returns false.
Copyright © 2004 Trolltech. | Trademarks | Qt 4.0.0-tp2 |