From a8c14b558afda35607c93bbbc34e7e33b005815c Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Thu, 5 Jan 2017 15:51:14 +0100 Subject: [PATCH] Utils: Fix warnings in Treemodel We made a implicit const cast. Like it is said C-style can be harmful because they are not const safe etc.. Change-Id: I6b41c10c18d37af4caf58574359fdce7d4a420ca Reviewed-by: hjk --- src/libs/utils/treemodel.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libs/utils/treemodel.cpp b/src/libs/utils/treemodel.cpp index fc8b55272db..a8b7dfb503d 100644 --- a/src/libs/utils/treemodel.cpp +++ b/src/libs/utils/treemodel.cpp @@ -907,7 +907,7 @@ QModelIndex BaseTreeModel::parent(const QModelIndex &idx) const const TreeItem *item = itemForIndex(idx); QTC_ASSERT(item, return QModelIndex()); - const TreeItem *parent = item->parent(); + TreeItem *parent = item->parent(); if (!parent || parent == m_root) return QModelIndex(); @@ -917,7 +917,7 @@ QModelIndex BaseTreeModel::parent(const QModelIndex &idx) const for (int i = 0, n = grandparent->childCount(); i < n; ++i) if (grandparent->childAt(i) == parent) - return createIndex(i, 0, (void*) parent); + return createIndex(i, 0, static_cast(parent)); return QModelIndex(); } @@ -1043,11 +1043,11 @@ QModelIndex BaseTreeModel::index(int row, int column, const QModelIndex &parent) if (!hasIndex(row, column, parent)) return QModelIndex(); - const TreeItem *item = itemForIndex(parent); + TreeItem *item = itemForIndex(parent); QTC_ASSERT(item, return QModelIndex()); if (row >= item->childCount()) return QModelIndex(); - return createIndex(row, column, (void*)(item->childAt(row))); + return createIndex(row, column, static_cast(item->childAt(row))); } TreeItem *BaseTreeModel::itemForIndex(const QModelIndex &idx) const