diff options
author | Ben Boeckel <MathStuf@gmail.com> | 2009-05-20 21:32:10 -0400 |
---|---|---|
committer | Ben Boeckel <MathStuf@gmail.com> | 2009-05-20 21:33:04 -0400 |
commit | 1505b2bf7de864c62ae6a7e5496022292895fe34 (patch) | |
tree | 3197811bcc0532f10c994ff2d44c20b9bc7b88d3 /sigmodr/tree | |
parent | f0ebc4ff3243eb697a632052436806e650296916 (diff) | |
download | sigen-1505b2bf7de864c62ae6a7e5496022292895fe34.tar.gz sigen-1505b2bf7de864c62ae6a7e5496022292895fe34.tar.xz sigen-1505b2bf7de864c62ae6a7e5496022292895fe34.zip |
Only row 0 has children
Diffstat (limited to 'sigmodr/tree')
-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 ff7426bd..4ccd47f5 100644 --- a/sigmodr/tree/TreeModel.cpp +++ b/sigmodr/tree/TreeModel.cpp @@ -93,7 +93,7 @@ QModelIndex TreeModel::parent(const QModelIndex& child) const bool TreeModel::hasChildren(const QModelIndex& parent) const { - if (!parent.isValid()) + if (!parent.isValid() || (0 < parent.column())) return false; return (0 < static_cast<TreeItem*>(parent.internalPointer())->childCount()); } @@ -102,6 +102,8 @@ int TreeModel::rowCount(const QModelIndex& parent) const { if (!parent.isValid()) return 0; + if (0 < parent.column()) + return 0; return static_cast<TreeItem*>(parent.internalPointer())->childCount(); } |