summaryrefslogtreecommitdiffstats
path: root/Source/QtDialog
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2013-03-12 10:30:59 (GMT)
committerBrad King <brad.king@kitware.com>2013-03-12 22:41:26 (GMT)
commit404e1d675ab1359bc79d3631abca911f178afcf4 (patch)
treef31c864eb68cd6d3026c9d83c9391341e17d1983 /Source/QtDialog
parent5144f6fb1121492d963c9a266650d219ee7eccc3 (diff)
downloadCMake-404e1d675ab1359bc79d3631abca911f178afcf4.zip
CMake-404e1d675ab1359bc79d3631abca911f178afcf4.tar.gz
CMake-404e1d675ab1359bc79d3631abca911f178afcf4.tar.bz2
cmake-gui: Workaround bug in Qt 5.0.0 to 5.0.3 QStandardItemModel
The commit in qtbase 9dfba89c (Add implementations of QAIM::sibling in public APIs., 2012-09-26) added a buggy implementation of sibling(), and the commit f136701b (Use the base implementation of QAbstractItemModel::sibling in QSIM., 2013-02-21) resolves it. Workaround the bug for Qt releases that have it.
Diffstat (limited to 'Source/QtDialog')
-rw-r--r--Source/QtDialog/QCMakeCacheView.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/Source/QtDialog/QCMakeCacheView.cxx b/Source/QtDialog/QCMakeCacheView.cxx
index 1d21d42..031350b 100644
--- a/Source/QtDialog/QCMakeCacheView.cxx
+++ b/Source/QtDialog/QCMakeCacheView.cxx
@@ -490,7 +490,11 @@ QCMakePropertyList QCMakeCacheModel::properties() const
}
// go to the next in the tree
- while(!idxs.isEmpty() && !idxs.last().sibling(idxs.last().row()+1, 0).isValid())
+ while(!idxs.isEmpty() && (
+#if QT_VERSION < QT_VERSION_CHECK(5, 0, 3)
+ (idxs.last().row()+1) >= rowCount(idxs.last().parent()) ||
+#endif
+ !idxs.last().sibling(idxs.last().row()+1, 0).isValid()))
{
idxs.removeLast();
}