Make handling of model ids compatible with Qt 5.

QAbstractItemModel::internalId() returns a quintptr in Qt 5. Handle this
in a way compatible with both Qt 4 and Qt 5.

Change-Id: Iacb9ab71e95085f061fac1e3f4e4759ed43ca7ef
Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
Christian Kandeler
2012-09-24 15:48:17 +02:00
committed by hjk
parent db0a6f525b
commit 4e4580d4c2
2 changed files with 13 additions and 7 deletions

View File

@@ -192,7 +192,7 @@ QModelIndex StackModel::parent(const QModelIndex &child) const
{
QTC_ASSERT(!child.isValid() || child.model() == this, return QModelIndex());
if (child.internalId() == -1)
if (quintptr(child.internalId()) == quintptr(-1))
return QModelIndex();
return createIndex(child.internalId(), 0, -1);
}