diff options
author | Ben Boeckel <MathStuf@gmail.com> | 2009-05-20 21:31:05 -0400 |
---|---|---|
committer | Ben Boeckel <MathStuf@gmail.com> | 2009-05-20 21:31:05 -0400 |
commit | 8169dccd2abb9f9ea8c79f76fcbd6fe9476610a0 (patch) | |
tree | 2e2397284f46a5a27198f6fa87812c6cd9b6a242 /sigmodr/tree/TreeModel.cpp | |
parent | eee50e22f49170671ccce7f4ce5e7e4925cd9288 (diff) | |
download | sigen-8169dccd2abb9f9ea8c79f76fcbd6fe9476610a0.tar.gz sigen-8169dccd2abb9f9ea8c79f76fcbd6fe9476610a0.tar.xz sigen-8169dccd2abb9f9ea8c79f76fcbd6fe9476610a0.zip |
Fix up the parent method (get the correct row)
Diffstat (limited to 'sigmodr/tree/TreeModel.cpp')
-rw-r--r-- | sigmodr/tree/TreeModel.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sigmodr/tree/TreeModel.cpp b/sigmodr/tree/TreeModel.cpp index cfccbcea..36eb5055 100644 --- a/sigmodr/tree/TreeModel.cpp +++ b/sigmodr/tree/TreeModel.cpp @@ -85,10 +85,10 @@ QModelIndex TreeModel::parent(const QModelIndex& child) const { if (!child.isValid()) return QModelIndex(); - TreeItem* item = static_cast<TreeItem*>(child.internalPointer()); - if (!item->parent()) + TreeItem* parent = static_cast<TreeItem*>(child.internalPointer())->parent(); + if (!parent) return QModelIndex(); - return createIndex(item->row(), 0, item->parent()); + return createIndex(parent->row(), 0, parent); } bool TreeModel::hasChildren(const QModelIndex& parent) const |