summaryrefslogtreecommitdiffstats
path: root/examples/widgets/itemviews/simpletreemodel/treemodel.cpp
diff options
context:
space:
mode:
authorDavid Faure <david.faure@kdab.com>2014-05-15 23:34:21 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-05-25 12:32:56 +0200
commit739fc9f24ea35bf55f853a970fe5ec27ef7a82ef (patch)
treeaf6b77a4006546ca8dc248876ab96a01e397ab00 /examples/widgets/itemviews/simpletreemodel/treemodel.cpp
parent5b0bf90d262ba6ece448c463d0fed5095cd5eb21 (diff)
simpletreemodel example: rename parent() to parentItem() for clarity
I show this example during trainings, and parent() is too much like QObject::parent(), QModelIndex::parent() and our model's parent() [which calls this method], so it's less confusing if this is called something clearer like parentItem(). Change-Id: I101342051349d94c4a3bc3d4bc332194d6779293 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Diffstat (limited to 'examples/widgets/itemviews/simpletreemodel/treemodel.cpp')
-rw-r--r--examples/widgets/itemviews/simpletreemodel/treemodel.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/widgets/itemviews/simpletreemodel/treemodel.cpp b/examples/widgets/itemviews/simpletreemodel/treemodel.cpp
index 971a813328..b15a717ef2 100644
--- a/examples/widgets/itemviews/simpletreemodel/treemodel.cpp
+++ b/examples/widgets/itemviews/simpletreemodel/treemodel.cpp
@@ -143,7 +143,7 @@ QModelIndex TreeModel::parent(const QModelIndex &index) const
return QModelIndex();
TreeItem *childItem = static_cast<TreeItem*>(index.internalPointer());
- TreeItem *parentItem = childItem->parent();
+ TreeItem *parentItem = childItem->parentItem();
if (parentItem == rootItem)
return QModelIndex();