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

QModelIndexList QListView::selectedIndexes (  )  const [protected, virtual, inherited]

Reimplemented from QAbstractItemView.

Definition at line 1582 of file qlistview.cpp.

References QList< T >::append(), QList< T >::at(), QModelIndex::column(), QList< T >::count(), QListView::isIndexHidden(), and QModelIndex::parent().

Referenced by QListWidget::dropEvent().

{
    Q_D(const QListView);
    QModelIndexList viewSelected;
    QModelIndexList modelSelected;
    if (d->selectionModel)
        modelSelected = d->selectionModel->selectedIndexes();
    for (int i = 0; i < modelSelected.count(); ++i) {
        QModelIndex index = modelSelected.at(i);
        if (!isIndexHidden(index) && index.parent() == d->root && index.column() == d->column)
            viewSelected.append(index);
    }
    return viewSelected;
}


Generated by  Doxygen 1.6.0   Back to index