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

void QTreeWidget::setHeaderLabels ( const QStringList labels  ) 

Adds a column in the header for each item in the labels list, and sets the label for each column.

Note that setHeaderLabels wont remove existing columns.

Definition at line 2019 of file qtreewidget.cpp.

References QList< T >::at(), QList< T >::count(), QAbstractItemView::model(), and QTreeWidgetItem::setText().

{
    Q_D(QTreeWidget);
    QTreeModel *model = d->model();
    QTreeWidgetItem *item = model->header;
    for (int i = 0; i < labels.count(); ++i)
        item->setText(i, labels.at(i));
}


Generated by  Doxygen 1.6.0   Back to index