Commit bca7015c authored by hjk's avatar hjk

TreeModel: More sanity checks

Change-Id: I5f452c94ba4970cadda7840b8a5bcbe8871d84ac
Reviewed-by: default avatarChristian Stenger <christian.stenger@theqtcompany.com>
parent b1e36da1
......@@ -993,7 +993,10 @@ QModelIndex TreeModel::index(int row, int column, const QModelIndex &parent) con
TreeItem *TreeModel::itemFromIndex(const QModelIndex &idx) const
{
CHECK_INDEX(idx);
return idx.isValid() ? static_cast<TreeItem*>(idx.internalPointer()) : m_root;
TreeItem *item = idx.isValid() ? static_cast<TreeItem*>(idx.internalPointer()) : m_root;
QTC_ASSERT(item, return 0);
QTC_ASSERT(item->m_model == this, return 0);
return item;
}
QModelIndex TreeModel::indexFromItem(const TreeItem *item) 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