From 8169dccd2abb9f9ea8c79f76fcbd6fe9476610a0 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Wed, 20 May 2009 21:31:05 -0400 Subject: Fix up the parent method (get the correct row) --- sigmodr/tree/TreeModel.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sigmodr/tree/TreeModel.cpp') 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(child.internalPointer()); - if (!item->parent()) + TreeItem* parent = static_cast(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 -- cgit