Logo Search packages:      
Sourcecode: qt4-x11 version File versions  Download package

QListWidgetItem::QListWidgetItem ( const QString text,
QListWidget parent = 0,
int  type = Type 
) [explicit]

Constructs an empty 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 list widget with QListWidget::insertItem().

See also:
type()

Definition at line 589 of file qlistwidget.cpp.

References QAbstractItemView::model(), and setData().

    : rtti(type), view(0), d(new QListWidgetItemPrivate(this)),
      itemFlags(Qt::ItemIsSelectable
                |Qt::ItemIsUserCheckable
                |Qt::ItemIsEnabled
                |Qt::ItemIsDragEnabled)
{
    setData(Qt::DisplayRole, text);
    this->view = view;
    if (QListModel *model = (view ? ::qobject_cast<QListModel*>(view->model()) : 0))
        model->insert(model->rowCount(), this);
}


Generated by  Doxygen 1.6.0   Back to index