Remove Q_ASSERT from QItemModel autotest
If populateTestData() would return an invalid model index, report a meaningful fatal error rather than failing silently in a release build and aborting with an uninformative error message in a debug build. Change-Id: I96820429a25ce5c4eb375d50e7e1f672851e26e6 Task-number: QTBUG-17582 Reviewed-by: Rohan McGovern (cherry picked from commit 984a72a8bbf853059f0eb7e1054538b48d5f3bc8)
This commit is contained in:
parent
65833e7d9e
commit
fa42ba9b62
@ -308,7 +308,8 @@ QModelIndex ModelsToTest::populateTestArea(QAbstractItemModel *model)
|
||||
*/
|
||||
}
|
||||
QModelIndex returnIndex = model->index(0,0);
|
||||
Q_ASSERT(returnIndex.isValid());
|
||||
if (!returnIndex.isValid())
|
||||
qFatal("%s: model index to be returned is invalid", Q_FUNC_INFO);
|
||||
return returnIndex;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user