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

QModelIndex QStandardItemModel::index ( int  row,
int  column,
const QModelIndex parent = QModelIndex() 
) const [virtual]

Implements QAbstractItemModel.

Definition at line 2687 of file qstandarditemmodel.cpp.

References QStandardItem::columnCount(), QAbstractItemModel::createIndex(), and QStandardItem::rowCount().

Referenced by findItems(), MainWindow::modelFromFile(), and QTreeWidgetItem::setChildIndicatorPolicy().

{
    Q_D(const QStandardItemModel);
    QStandardItem *parentItem = d->itemFromIndex(parent);
    if ((parentItem == 0)
        || (row < 0)
        || (column < 0)
        || (row >= parentItem->rowCount())
        || (column >= parentItem->columnCount())) {
        return QModelIndex();
    }
    return createIndex(row, column, parentItem);
}


Generated by  Doxygen 1.6.0   Back to index