diff options
| author | Ben Boeckel <MathStuf@gmail.com> | 2009-05-03 12:21:32 -0400 |
|---|---|---|
| committer | Ben Boeckel <MathStuf@gmail.com> | 2009-05-03 12:21:32 -0400 |
| commit | eee50e22f49170671ccce7f4ce5e7e4925cd9288 (patch) | |
| tree | c87f39df4475a9ad64c603615948719d44a974c3 /sigmodr/tree/TreeModel.cpp | |
| parent | 3921cd26a481ff4c69fbf8c71050d778b35d80a3 (diff) | |
| download | sigen-eee50e22f49170671ccce7f4ce5e7e4925cd9288.tar.gz sigen-eee50e22f49170671ccce7f4ce5e7e4925cd9288.tar.xz sigen-eee50e22f49170671ccce7f4ce5e7e4925cd9288.zip | |
Fix handling of extra columns
Diffstat (limited to 'sigmodr/tree/TreeModel.cpp')
| -rw-r--r-- | sigmodr/tree/TreeModel.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sigmodr/tree/TreeModel.cpp b/sigmodr/tree/TreeModel.cpp index 0ec202fc..cfccbcea 100644 --- a/sigmodr/tree/TreeModel.cpp +++ b/sigmodr/tree/TreeModel.cpp @@ -76,7 +76,7 @@ QModelIndex TreeModel::index(const int row, const int column, const QModelIndex& return QModelIndex(); } TreeItem* item = static_cast<TreeItem*>(parent.internalPointer()); - if (column || (row < 0) || (item->childCount() <= row)) + if ((row < 0) || (item->childCount() <= row) || (column < 0) || (4 <= column)) return QModelIndex(); return createIndex(row, column, item->childAt(row)); } @@ -108,6 +108,8 @@ int TreeModel::rowCount(const QModelIndex& parent) const int TreeModel::columnCount(const QModelIndex& parent) const { + if (!parent.isValid()) + return 0; return 4; } |
