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

QModelIndex QTreeView::indexAt ( const QPoint point  )  const [virtual, inherited]

Implements QAbstractItemView.

Definition at line 1038 of file qtreeview.cpp.

References QModelIndex::isValid(), QAbstractItemView::model(), QModelIndex::row(), QAbstractItemModel::sibling(), QPoint::x(), and QPoint::y().

Referenced by itemAt(), and QTreeView::setSelection().

{
    Q_D(const QTreeView);
    d->executePostedLayout();

    int visualIndex = d->item(point.y());
    QModelIndex idx = d->modelIndex(visualIndex);
    int column = d->columnAt(point.x());
    if (idx.isValid() && column >= 0)
        return model()->sibling(idx.row(), column, idx);
    return QModelIndex();
}


Generated by  Doxygen 1.6.0   Back to index