Commit a8c14b55 authored by Marco Bubke's avatar Marco Bubke

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: default avatarhjk <hjk@qt.io>
parent e9a2996f
...@@ -907,7 +907,7 @@ QModelIndex BaseTreeModel::parent(const QModelIndex &idx) const ...@@ -907,7 +907,7 @@ QModelIndex BaseTreeModel::parent(const QModelIndex &idx) const
const TreeItem *item = itemForIndex(idx); const TreeItem *item = itemForIndex(idx);
QTC_ASSERT(item, return QModelIndex()); QTC_ASSERT(item, return QModelIndex());
const TreeItem *parent = item->parent(); TreeItem *parent = item->parent();
if (!parent || parent == m_root) if (!parent || parent == m_root)
return QModelIndex(); return QModelIndex();
...@@ -917,7 +917,7 @@ QModelIndex BaseTreeModel::parent(const QModelIndex &idx) const ...@@ -917,7 +917,7 @@ QModelIndex BaseTreeModel::parent(const QModelIndex &idx) const
for (int i = 0, n = grandparent->childCount(); i < n; ++i) for (int i = 0, n = grandparent->childCount(); i < n; ++i)
if (grandparent->childAt(i) == parent) if (grandparent->childAt(i) == parent)
return createIndex(i, 0, (void*) parent); return createIndex(i, 0, static_cast<void*>(parent));
return QModelIndex(); return QModelIndex();
} }
...@@ -1043,11 +1043,11 @@ QModelIndex BaseTreeModel::index(int row, int column, const QModelIndex &parent) ...@@ -1043,11 +1043,11 @@ QModelIndex BaseTreeModel::index(int row, int column, const QModelIndex &parent)
if (!hasIndex(row, column, parent)) if (!hasIndex(row, column, parent))
return QModelIndex(); return QModelIndex();
const TreeItem *item = itemForIndex(parent); TreeItem *item = itemForIndex(parent);
QTC_ASSERT(item, return QModelIndex()); QTC_ASSERT(item, return QModelIndex());
if (row >= item->childCount()) if (row >= item->childCount())
return QModelIndex(); return QModelIndex();
return createIndex(row, column, (void*)(item->childAt(row))); return createIndex(row, column, static_cast<void*>(item->childAt(row)));
} }
TreeItem *BaseTreeModel::itemForIndex(const QModelIndex &idx) const TreeItem *BaseTreeModel::itemForIndex(const QModelIndex &idx) const
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment