Home · All Namespaces · All Classes · Grouped Classes · Modules · Functions codeless banner

QSmoothListWidgetItem Class Reference
[QtBaseModule]

The QSmoothListWidgetItem class provides an item for use with the QSmoothListWidget item view class. More...

    #include <QSmoothListWidgetItem>

Inherits QStandardItem.

Public Functions

Additional Inherited Members


Detailed Description

The QSmoothListWidgetItem class provides an item for use with the QSmoothListWidget item view class.

QSmoothListWidgetItem is used to represent items in a list provided by the QSmoothListWidget class. Each item can hold several pieces of information, and will display these appropriately.

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 QSmoothList class with a standard model.

List items can be automatically inserted into a list when they are constructed by specifying the list widget:

They can also be created without a parent widget, and later inserted into a list (see QSmoothListWidget::insertItem()).

QSmoothListWidgetItem is designed to be a drop-in replacement for simple uses of QSmoothListWidgetItem, when you are using a QSmoothListWidget instead of a QSmoothListWidget. QSmoothListWidgetItem does behave slightly differently though, most notably in that it cannot be hidden.

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(), setForeground(), and setBackground(). Text in list items can be aligned using the setTextAlignment() function.

By default, items are enabled, selectable, and checkable. Each item's flags can be changed by calling setFlags() with the appropriate value (see Qt::ItemFlags). Checkable items can be checked, unchecked and partially checked with the setCheckState() function. The corresponding checkState() function indicates what check state the item currently has.

See also QListWidgetItem, QSmoothListWidget, and QSmoothList.


Member Function Documentation

QSmoothListWidgetItem::QSmoothListWidgetItem ( QSmoothListWidget * parent = 0, int type = Type )

Constructs an empty smooth list widget item of the specified type with the given parent. If the parent is not specified, the item will need to be inserted into a smooth list widget with QSmoothListWidget::insertItem().

See also type().

QSmoothListWidgetItem::QSmoothListWidgetItem ( const QString & text, QSmoothListWidget * parent = 0, int type = Type )

Constructs an empty smooth list widget item of the specified type with the given text and parent. If the parent is not specified, the item will need to be inserted into a smooth list widget with QSmoothListWidget::insertItem().

See also type().

QSmoothListWidgetItem::QSmoothListWidgetItem ( const QIcon & icon, const QString & text, QSmoothListWidget * parent = 0, int type = Type )

Constructs an empty smooth list widget item of the specified type with the given icon, text and parent. If the parent is not specified, the item will need to be inserted into a smooth list widget with QSmoothListWidget::insertItem().

See also type().

void QSmoothListWidgetItem::setData ( int role, const QVariant & value )   [virtual]

Sets the item's data for the given role to the specified value.

Same as QStandardItem::setData() but with the parameters reversed.

Included for compatibilty with QListWidgetItem.

QSmoothListWidget * QSmoothListWidgetItem::smoothListWidget () const

Returns the smooth list widget that contains the item.

int QSmoothListWidgetItem::type () const   [virtual]

Returns the type passed to the QSmoothListWidgetItem constructor.

Reimplemented from QStandardItem.


Copyright © 2009 Trolltech Trademarks
Qt Extended 4.4.3