diff options
| author | Ben Boeckel <MathStuf@gmail.com> | 2008-04-28 14:22:19 +0000 |
|---|---|---|
| committer | Ben Boeckel <MathStuf@gmail.com> | 2008-04-28 14:22:19 +0000 |
| commit | 807d2b93bf41682ec1093598f30abe74866e5994 (patch) | |
| tree | c7f12110361e6c44402af0a894dd116b99e68c94 /pokemodr/PokemodTreeModel.cpp | |
| parent | 0fa52c1f61c457c9b68bec53bcce3af858e5eb44 (diff) | |
| download | sigen-807d2b93bf41682ec1093598f30abe74866e5994.tar.gz sigen-807d2b93bf41682ec1093598f30abe74866e5994.tar.xz sigen-807d2b93bf41682ec1093598f30abe74866e5994.zip | |
[FIX] De-inlined some methods
[FIX] More mounds checking
[FIX] RootModel inherits GroupModel
[FIX] Tree displays correctly (though segfaults on some expansion)
[FIX] Some more header cleanup
git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@113 6ecfd1a5-f3ed-3746-8530-beee90d26b22
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; |
