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

void QTreeView::setSelectionModel ( QItemSelectionModel selectionModel  )  [virtual, inherited]

Reimplemented from QAbstractItemView.

Definition at line 169 of file qtreeview.cpp.

References QObject::connect(), QObject::disconnect(), and QAbstractItemView::setSelectionModel().

{
    Q_D(QTreeView);
    Q_ASSERT(selectionModel);
    if (d->model && d->selectionModel) // support row editing
        disconnect(d->selectionModel, SIGNAL(currentRowChanged(QModelIndex,QModelIndex)),
                   d->model, SLOT(submit()));

    d->header->setSelectionModel(selectionModel);
    QAbstractItemView::setSelectionModel(selectionModel);

    if (d->model && d->selectionModel) // support row editing
        connect(d->selectionModel, SIGNAL(currentRowChanged(QModelIndex,QModelIndex)),
                d->model, SLOT(submit()));
}


Generated by  Doxygen 1.6.0   Back to index