mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-17 02:42:45 +00:00
Proper index creation for nested data
This commit is contained in:
parent
fcf9ae42f4
commit
c088cd4fa9
@ -171,10 +171,10 @@ QModelIndex CSMWorld::IdTree::index (int row, int column, const QModelIndex& par
|
||||
encodedId = this->foldIndexAddress(parent);
|
||||
}
|
||||
|
||||
if (row<0 || row>=idCollection()->getSize())
|
||||
if (row < 0 || row >= rowCount(parent))
|
||||
return QModelIndex();
|
||||
|
||||
if (column<0 || column>=idCollection()->getColumns())
|
||||
if (column < 0 || column >= columnCount(parent))
|
||||
return QModelIndex();
|
||||
|
||||
return createIndex(row, column, encodedId); // store internal id
|
||||
|
@ -75,10 +75,10 @@ QModelIndex CSMWorld::NestedTableProxyModel::index(int row, int column, const QM
|
||||
{
|
||||
assert (!parent.isValid());
|
||||
|
||||
int rows = mMainModel->rowCount(parent);
|
||||
int columns = mMainModel->columnCount(parent);
|
||||
int numRows = rowCount(parent);
|
||||
int numColumns = columnCount(parent);
|
||||
|
||||
if (row < 0 || row >= rows || column < 0 || column >= columns)
|
||||
if (row < 0 || row >= numRows || column < 0 || column >= numColumns)
|
||||
return QModelIndex();
|
||||
|
||||
return createIndex(row, column);
|
||||
|
Loading…
x
Reference in New Issue
Block a user