diff options
Diffstat (limited to 'pokemodr/PokemodTreeModel.cpp')
| -rw-r--r-- | pokemodr/PokemodTreeModel.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/pokemodr/PokemodTreeModel.cpp b/pokemodr/PokemodTreeModel.cpp index 5271ba15..17331047 100644 --- a/pokemodr/PokemodTreeModel.cpp +++ b/pokemodr/PokemodTreeModel.cpp @@ -52,8 +52,8 @@ QVariant PokemodTreeModel::headerData(int /*section*/, Qt::Orientation /*orienta QModelIndex PokemodTreeModel::index(int row, int /*column*/, const QModelIndex& parent) const { - if (!parent.isValid()) - return QModelIndex(); + if (row < 0) + return createIndex(-1, 0, m_root); BaseModel* object = getItem(parent)->childItem(row); if (object) return createIndex(row, 0, object); @@ -77,6 +77,7 @@ int PokemodTreeModel::rowCount(const QModelIndex& parent) const BaseModel* object = getItem(parent); return object->rowCount(); } + int PokemodTreeModel::columnCount(const QModelIndex& /*parent*/) const { return 1; |
