From 5144f6fb1121492d963c9a266650d219ee7eccc3 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Tue, 12 Mar 2013 11:23:53 +0100 Subject: [PATCH 1/2] cmake-gui: Use -fPIE if required by Qt. --- Source/QtDialog/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt index 29daffde8..1684fb229 100644 --- a/Source/QtDialog/CMakeLists.txt +++ b/Source/QtDialog/CMakeLists.txt @@ -27,6 +27,8 @@ if (Qt5Widgets_FOUND) set(QT_LIBRARIES ${Qt5Widgets_LIBRARIES}) # Remove this when the minimum version of Qt is 4.6. add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0) + + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}") else() set(QT_MIN_VERSION "4.4.0") find_package(Qt4 REQUIRED) From 404e1d675ab1359bc79d3631abca911f178afcf4 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Tue, 12 Mar 2013 11:30:59 +0100 Subject: [PATCH 2/2] 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. --- Source/QtDialog/QCMakeCacheView.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Source/QtDialog/QCMakeCacheView.cxx b/Source/QtDialog/QCMakeCacheView.cxx index 1d21d421d..031350ba4 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(); }