浏览代码

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.
Stephen Kelly 12 年之前
父节点
当前提交
404e1d675a
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      Source/QtDialog/QCMakeCacheView.cxx

+ 5 - 1
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();
       }