Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.0.1
-
None
-
WinXp and Win7, Qt5.0.1, msvc2010, QtCreator 2.6.2
Description
QModelIndex::isValid() returns true for non-existing siblings of an index, e.g model.index(0,0).sibling(100,100).isValid()
To reproduce, change this line in of code in spinboxdelegate example:
tableView.setWindowTitle(QObject::tr("Spin Box Delegate")
to:
QString isValidTest = model.index(0,0).sibling(100,100).isValid() ? ":VALID (NOK)" : ":INVALID (OK)";
tableView.setWindowTitle(QObject::tr("Spin Box Delegate") + isValidTest);
Qt4.8.3, msvc2008 -> index is invalid (OK)
Qt5.0.1, msvc2010 -> index is valid (NOK)