From 08e73d1a9336c97b87d00f5fc1dec98c846f4eca Mon Sep 17 00:00:00 2001 From: hjk Date: Tue, 20 Feb 2018 09:26:23 +0100 Subject: [PATCH] Utils: Remove BaseTreeModel::hasChildren re-implementation Not needed and wrong, as it doesn't handle the case of column != 0. Change-Id: I0ff62df0547a47ea80e1450b7cca1ecc86da7005 Reviewed-by: Ivan Donchevskii --- src/libs/utils/treemodel.cpp | 6 ------ src/libs/utils/treemodel.h | 1 - 2 files changed, 7 deletions(-) diff --git a/src/libs/utils/treemodel.cpp b/src/libs/utils/treemodel.cpp index d0dab99c0d8..0493a67a4a8 100644 --- a/src/libs/utils/treemodel.cpp +++ b/src/libs/utils/treemodel.cpp @@ -1028,12 +1028,6 @@ QVariant BaseTreeModel::headerData(int section, Qt::Orientation orientation, return QVariant(); } -bool BaseTreeModel::hasChildren(const QModelIndex &idx) const -{ - TreeItem *item = itemForIndex(idx); - return !item || item->hasChildren(); -} - Qt::ItemFlags BaseTreeModel::flags(const QModelIndex &idx) const { if (!idx.isValid()) diff --git a/src/libs/utils/treemodel.h b/src/libs/utils/treemodel.h index 930f6f5e2ec..fd299bd9455 100644 --- a/src/libs/utils/treemodel.h +++ b/src/libs/utils/treemodel.h @@ -193,7 +193,6 @@ protected: QModelIndex sibling(int row, int column, const QModelIndex &idx) const override; Qt::ItemFlags flags(const QModelIndex &idx) const override; QVariant headerData(int section, Qt::Orientation orientation, int role) const override; - bool hasChildren(const QModelIndex &idx) const override; bool canFetchMore(const QModelIndex &idx) const override; void fetchMore(const QModelIndex &idx) override;