From e4d601546044be33f6eee549373ea093aa240d43 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Mon, 1 Jun 2020 11:35:34 -0400 Subject: QtDialog: remove Qt4 support --- Help/release/dev/remove-cmake-gui-qt4.rst | 5 + Source/QtDialog/CMakeLists.txt | 168 ++++++++++++++---------------- 2 files changed, 82 insertions(+), 91 deletions(-) create mode 100644 Help/release/dev/remove-cmake-gui-qt4.rst diff --git a/Help/release/dev/remove-cmake-gui-qt4.rst b/Help/release/dev/remove-cmake-gui-qt4.rst new file mode 100644 index 0000000..2b29b75 --- /dev/null +++ b/Help/release/dev/remove-cmake-gui-qt4.rst @@ -0,0 +1,5 @@ +remove-cmake-gui-qt4 +-------------------- + +* :manual:`cmake-gui(1)` now requires Qt5. Support for compiling with Qt4 has + been removed. diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt index 98dd0e2..08047b4 100644 --- a/Source/QtDialog/CMakeLists.txt +++ b/Source/QtDialog/CMakeLists.txt @@ -3,111 +3,97 @@ project(QtDialog) CMake_OPTIONAL_COMPONENT(cmake-gui) -find_package(Qt5Widgets QUIET) -if (Qt5Widgets_FOUND) - include_directories(${Qt5Widgets_INCLUDE_DIRS}) - add_definitions(${Qt5Widgets_DEFINITONS}) - macro(qt4_wrap_ui) - qt5_wrap_ui(${ARGN}) - endmacro() - macro(qt4_wrap_cpp) - qt5_wrap_cpp(${ARGN}) - endmacro() - macro(qt4_add_resources) - qt5_add_resources(${ARGN}) - endmacro() +find_package(Qt5Widgets REQUIRED) +include_directories(${Qt5Widgets_INCLUDE_DIRS}) +add_definitions(${Qt5Widgets_DEFINITONS}) +macro(qt4_wrap_ui) + qt5_wrap_ui(${ARGN}) +endmacro() +macro(qt4_wrap_cpp) + qt5_wrap_cpp(${ARGN}) +endmacro() +macro(qt4_add_resources) + qt5_add_resources(${ARGN}) +endmacro() - set(CMake_QT_LIBRARIES ${Qt5Widgets_LIBRARIES}) - set(QT_QTMAIN_LIBRARY ${Qt5Core_QTMAIN_LIBRARIES}) +set(CMake_QT_LIBRARIES ${Qt5Widgets_LIBRARIES}) +set(QT_QTMAIN_LIBRARY ${Qt5Core_QTMAIN_LIBRARIES}) - # Try to find the package WinExtras for the task bar progress - if(WIN32) - find_package(Qt5WinExtras QUIET) - if (Qt5WinExtras_FOUND) - include_directories(${Qt5WinExtras_INCLUDE_DIRS}) - add_definitions(-DQT_WINEXTRAS) - list(APPEND CMake_QT_LIBRARIES ${Qt5WinExtras_LIBRARIES}) - endif() +# Try to find the package WinExtras for the task bar progress +if(WIN32) + find_package(Qt5WinExtras QUIET) + if (Qt5WinExtras_FOUND) + include_directories(${Qt5WinExtras_INCLUDE_DIRS}) + add_definitions(-DQT_WINEXTRAS) + list(APPEND CMake_QT_LIBRARIES ${Qt5WinExtras_LIBRARIES}) endif() +endif() - # Remove this when the minimum version of Qt is 4.6. - add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0) +# 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}") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}") - if(CMake_QT_STATIC_QXcbIntegrationPlugin_LIBRARIES) - list(APPEND CMake_QT_LIBRARIES ${CMake_QT_STATIC_QXcbIntegrationPlugin_LIBRARIES}) - set_property(SOURCE CMakeSetup.cxx - PROPERTY COMPILE_DEFINITIONS USE_QXcbIntegrationPlugin) - endif() +if(CMake_QT_STATIC_QXcbIntegrationPlugin_LIBRARIES) + list(APPEND CMake_QT_LIBRARIES ${CMake_QT_STATIC_QXcbIntegrationPlugin_LIBRARIES}) + set_property(SOURCE CMakeSetup.cxx + PROPERTY COMPILE_DEFINITIONS USE_QXcbIntegrationPlugin) +endif() - if(CMake_QT_STATIC_QWindowsIntegrationPlugin_LIBRARIES) - list(APPEND CMake_QT_LIBRARIES ${CMake_QT_STATIC_QWindowsIntegrationPlugin_LIBRARIES}) - set_property(SOURCE CMakeSetup.cxx - PROPERTY COMPILE_DEFINITIONS USE_QWindowsIntegrationPlugin) - endif() +if(CMake_QT_STATIC_QWindowsIntegrationPlugin_LIBRARIES) + list(APPEND CMake_QT_LIBRARIES ${CMake_QT_STATIC_QWindowsIntegrationPlugin_LIBRARIES}) + set_property(SOURCE CMakeSetup.cxx + PROPERTY COMPILE_DEFINITIONS USE_QWindowsIntegrationPlugin) +endif() - # We need to install platform plugin and add qt.conf for Qt5 on Mac and Windows. - # FIXME: This should be part of Qt5 CMake scripts, but unfortunately - # Qt5 support is missing there. - if(CMake_INSTALL_DEPENDENCIES AND (APPLE OR WIN32)) - macro(install_qt5_plugin _qt_plugin_name _qt_plugins_var) - get_target_property(_qt_plugin_path "${_qt_plugin_name}" LOCATION) - if(EXISTS "${_qt_plugin_path}") - get_filename_component(_qt_plugin_file "${_qt_plugin_path}" NAME) - get_filename_component(_qt_plugin_type "${_qt_plugin_path}" PATH) - get_filename_component(_qt_plugin_type "${_qt_plugin_type}" NAME) - if(APPLE) - set(_qt_plugin_dir "PlugIns") - elseif(WIN32) - set(_qt_plugin_dir "plugins") - endif() - set(_qt_plugin_dest "${_qt_plugin_dir}/${_qt_plugin_type}") - install(FILES "${_qt_plugin_path}" - DESTINATION "${_qt_plugin_dest}" - ${COMPONENT}) - set(${_qt_plugins_var} - "${${_qt_plugins_var}};\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${_qt_plugin_dest}/${_qt_plugin_file}") - else() - message(FATAL_ERROR "QT plugin ${_qt_plugin_name} not found") +# We need to install platform plugin and add qt.conf for Qt5 on Mac and Windows. +# FIXME: This should be part of Qt5 CMake scripts, but unfortunately +# Qt5 support is missing there. +if(CMake_INSTALL_DEPENDENCIES AND (APPLE OR WIN32)) + macro(install_qt5_plugin _qt_plugin_name _qt_plugins_var) + get_target_property(_qt_plugin_path "${_qt_plugin_name}" LOCATION) + if(EXISTS "${_qt_plugin_path}") + get_filename_component(_qt_plugin_file "${_qt_plugin_path}" NAME) + get_filename_component(_qt_plugin_type "${_qt_plugin_path}" PATH) + get_filename_component(_qt_plugin_type "${_qt_plugin_type}" NAME) + if(APPLE) + set(_qt_plugin_dir "PlugIns") + elseif(WIN32) + set(_qt_plugin_dir "plugins") endif() - endmacro() - if(APPLE) - install_qt5_plugin("Qt5::QCocoaIntegrationPlugin" QT_PLUGINS) - file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/qt.conf" - "[Paths]\nPlugins = ${_qt_plugin_dir}\n") - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/qt.conf" - DESTINATION "${CMAKE_INSTALL_PREFIX}/Resources" - ${COMPONENT}) - elseif(WIN32 AND NOT CMake_QT_STATIC_QWindowsIntegrationPlugin_LIBRARIES) - install_qt5_plugin("Qt5::QWindowsIntegrationPlugin" QT_PLUGINS) - file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/qt.conf" - "[Paths]\nPlugins = ../${_qt_plugin_dir}\n") - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/qt.conf" - DESTINATION bin + set(_qt_plugin_dest "${_qt_plugin_dir}/${_qt_plugin_type}") + install(FILES "${_qt_plugin_path}" + DESTINATION "${_qt_plugin_dest}" ${COMPONENT}) + set(${_qt_plugins_var} + "${${_qt_plugins_var}};\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${_qt_plugin_dest}/${_qt_plugin_file}") + else() + message(FATAL_ERROR "QT plugin ${_qt_plugin_name} not found") endif() + endmacro() + if(APPLE) + install_qt5_plugin("Qt5::QCocoaIntegrationPlugin" QT_PLUGINS) + file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/qt.conf" + "[Paths]\nPlugins = ${_qt_plugin_dir}\n") + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/qt.conf" + DESTINATION "${CMAKE_INSTALL_PREFIX}/Resources" + ${COMPONENT}) + elseif(WIN32 AND NOT CMake_QT_STATIC_QWindowsIntegrationPlugin_LIBRARIES) + install_qt5_plugin("Qt5::QWindowsIntegrationPlugin" QT_PLUGINS) + file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/qt.conf" + "[Paths]\nPlugins = ../${_qt_plugin_dir}\n") + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/qt.conf" + DESTINATION bin + ${COMPONENT}) endif() +endif() - if(TARGET Qt5::Core) - get_property(_Qt5_Core_LOCATION TARGET Qt5::Core PROPERTY LOCATION) - get_filename_component(Qt_BIN_DIR "${_Qt5_Core_LOCATION}" PATH) - if(APPLE) - get_filename_component(Qt_BIN_DIR "${Qt_BIN_DIR}" PATH) - endif() - endif() -else() - set(QT_MIN_VERSION "4.4.0") - find_package(Qt4 REQUIRED) - if(NOT QT4_FOUND) - message(SEND_ERROR "Failed to find Qt 4.4 or greater.") - return() +if(TARGET Qt5::Core) + get_property(_Qt5_Core_LOCATION TARGET Qt5::Core PROPERTY LOCATION) + get_filename_component(Qt_BIN_DIR "${_Qt5_Core_LOCATION}" PATH) + if(APPLE) + get_filename_component(Qt_BIN_DIR "${Qt_BIN_DIR}" PATH) endif() - - include(${QT_USE_FILE}) - - set(CMake_QT_LIBRARIES ${QT_LIBRARIES}) - endif() set(SRCS -- cgit v0.12 From 4ccc9921be03d26436a1a70dd134ee044c3734ab Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Mon, 1 Jun 2020 11:36:50 -0400 Subject: QtDialog: use qt5 functions for special Qt sources Automoc is not supported in bootstrap builds, so it cannot be used unconditionally. --- Source/QtDialog/CMakeLists.txt | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt index 08047b4..4a03f0b 100644 --- a/Source/QtDialog/CMakeLists.txt +++ b/Source/QtDialog/CMakeLists.txt @@ -6,15 +6,6 @@ CMake_OPTIONAL_COMPONENT(cmake-gui) find_package(Qt5Widgets REQUIRED) include_directories(${Qt5Widgets_INCLUDE_DIRS}) add_definitions(${Qt5Widgets_DEFINITONS}) -macro(qt4_wrap_ui) - qt5_wrap_ui(${ARGN}) -endmacro() -macro(qt4_wrap_cpp) - qt5_wrap_cpp(${ARGN}) -endmacro() -macro(qt4_add_resources) - qt5_add_resources(${ARGN}) -endmacro() set(CMake_QT_LIBRARIES ${Qt5Widgets_LIBRARIES}) set(QT_QTMAIN_LIBRARY ${Qt5Core_QTMAIN_LIBRARIES}) @@ -102,6 +93,7 @@ set(SRCS CMakeSetup.cxx CMakeSetupDialog.cxx CMakeSetupDialog.h + Compilers.h FirstConfigure.cxx FirstConfigure.h QCMake.cxx @@ -115,7 +107,7 @@ set(SRCS WarningMessagesDialog.cxx WarningMessagesDialog.h ) -QT4_WRAP_UI(UI_SRCS +qt5_wrap_ui(UI_SRCS CMakeSetupDialog.ui Compilers.ui CrossCompiler.ui @@ -123,7 +115,7 @@ QT4_WRAP_UI(UI_SRCS RegexExplorer.ui WarningMessagesDialog.ui ) -QT4_WRAP_CPP(MOC_SRCS +qt5_wrap_cpp(MOC_SRCS AddCacheEntry.h Compilers.h CMakeSetupDialog.h @@ -134,14 +126,24 @@ QT4_WRAP_CPP(MOC_SRCS RegexExplorer.h WarningMessagesDialog.h ) -QT4_ADD_RESOURCES(RC_SRCS CMakeSetup.qrc) +qt5_add_resources(RC_SRCS CMakeSetup.qrc) + +if (FALSE) # CMake's bootstrap binary does not support automoc + set(CMAKE_AUTOMOC 1) + set(CMAKE_AUTORCC 1) + set(CMAKE_AUTOUIC 1) +else () + list(APPEND SRCS + ${UI_SRCS} + ${MOC_SRCS} + ${RC_SRCS}) +endif () -set(SRCS ${SRCS} ${UI_SRCS} ${MOC_SRCS} ${RC_SRCS}) if(WIN32) - set(SRCS ${SRCS} CMakeSetup.rc) + list(APPEND SRCS CMakeSetup.rc) endif() if(APPLE) - set(SRCS ${SRCS} CMakeSetup.icns) + list(APPEND SRCS CMakeSetup.icns) set(MACOSX_BUNDLE_ICON_FILE CMakeSetup.icns) set_source_files_properties(CMakeSetup.icns PROPERTIES MACOSX_PACKAGE_LOCATION Resources) -- cgit v0.12 From 8ea50749da2c8687a31272754eeed54646de1682 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Mon, 1 Jun 2020 11:39:30 -0400 Subject: QtDialog: use Qt5's imported targets --- Source/QtDialog/CMakeLists.txt | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt index 4a03f0b..e1da7c6 100644 --- a/Source/QtDialog/CMakeLists.txt +++ b/Source/QtDialog/CMakeLists.txt @@ -4,19 +4,15 @@ project(QtDialog) CMake_OPTIONAL_COMPONENT(cmake-gui) find_package(Qt5Widgets REQUIRED) -include_directories(${Qt5Widgets_INCLUDE_DIRS}) -add_definitions(${Qt5Widgets_DEFINITONS}) -set(CMake_QT_LIBRARIES ${Qt5Widgets_LIBRARIES}) -set(QT_QTMAIN_LIBRARY ${Qt5Core_QTMAIN_LIBRARIES}) +set(CMake_QT_EXTRA_LIBRARIES) # Try to find the package WinExtras for the task bar progress if(WIN32) find_package(Qt5WinExtras QUIET) if (Qt5WinExtras_FOUND) - include_directories(${Qt5WinExtras_INCLUDE_DIRS}) add_definitions(-DQT_WINEXTRAS) - list(APPEND CMake_QT_LIBRARIES ${Qt5WinExtras_LIBRARIES}) + list(APPEND CMake_QT_EXTRA_LIBRARIES Qt5::WinExtras) endif() endif() @@ -26,13 +22,13 @@ add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}") if(CMake_QT_STATIC_QXcbIntegrationPlugin_LIBRARIES) - list(APPEND CMake_QT_LIBRARIES ${CMake_QT_STATIC_QXcbIntegrationPlugin_LIBRARIES}) + list(APPEND CMake_QT_EXTRA_LIBRARIES ${CMake_QT_STATIC_QXcbIntegrationPlugin_LIBRARIES}) set_property(SOURCE CMakeSetup.cxx PROPERTY COMPILE_DEFINITIONS USE_QXcbIntegrationPlugin) endif() if(CMake_QT_STATIC_QWindowsIntegrationPlugin_LIBRARIES) - list(APPEND CMake_QT_LIBRARIES ${CMake_QT_STATIC_QWindowsIntegrationPlugin_LIBRARIES}) + list(APPEND CMake_QT_EXTRA_LIBRARIES ${CMake_QT_STATIC_QWindowsIntegrationPlugin_LIBRARIES}) set_property(SOURCE CMakeSetup.cxx PROPERTY COMPILE_DEFINITIONS USE_QWindowsIntegrationPlugin) endif() @@ -79,12 +75,10 @@ if(CMake_INSTALL_DEPENDENCIES AND (APPLE OR WIN32)) endif() endif() -if(TARGET Qt5::Core) - get_property(_Qt5_Core_LOCATION TARGET Qt5::Core PROPERTY LOCATION) - get_filename_component(Qt_BIN_DIR "${_Qt5_Core_LOCATION}" PATH) - if(APPLE) - get_filename_component(Qt_BIN_DIR "${Qt_BIN_DIR}" PATH) - endif() +get_property(_Qt5_Core_LOCATION TARGET Qt5::Core PROPERTY LOCATION) +get_filename_component(Qt_BIN_DIR "${_Qt5_Core_LOCATION}" PATH) +if(APPLE) + get_filename_component(Qt_BIN_DIR "${Qt_BIN_DIR}" PATH) endif() set(SRCS @@ -160,7 +154,7 @@ endif() set(CMAKE_INCLUDE_CURRENT_DIR ON) add_executable(cmake-gui WIN32 MACOSX_BUNDLE ${SRCS} ${MANIFEST_FILE}) -target_link_libraries(cmake-gui CMakeLib ${QT_QTMAIN_LIBRARY} ${CMake_QT_LIBRARIES}) +target_link_libraries(cmake-gui CMakeLib Qt5::Core Qt5::Widgets ${CMake_QT_EXTRA_LIBRARIES}) if(WIN32) target_sources(cmake-gui PRIVATE $) -- cgit v0.12 From ce9dbceb42b6c9170a86c6f05a914b3a72f656c8 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Tue, 2 Jun 2020 14:32:29 -0400 Subject: QtDialog: remove Qt4-only code The `reset()` method was actually deprecated for 5.0 which means it can now be removed here. --- Source/QtDialog/CMakeSetup.cxx | 8 -------- Source/QtDialog/QCMake.cxx | 4 ---- Source/QtDialog/QCMakeCacheView.cxx | 33 +-------------------------------- Source/QtDialog/QCMakeCacheView.h | 1 - 4 files changed, 1 insertion(+), 45 deletions(-) diff --git a/Source/QtDialog/CMakeSetup.cxx b/Source/QtDialog/CMakeSetup.cxx index 9d928b2..7ef5a72 100644 --- a/Source/QtDialog/CMakeSetup.cxx +++ b/Source/QtDialog/CMakeSetup.cxx @@ -115,14 +115,6 @@ int main(int argc, char** argv) QTextCodec* utf8_codec = QTextCodec::codecForName("UTF-8"); QTextCodec::setCodecForLocale(utf8_codec); -#if QT_VERSION < 0x050000 - // clean out standard Qt paths for plugins, which we don't use anyway - // when creating Mac bundles, it potentially causes problems - foreach (QString p, QApplication::libraryPaths()) { - QApplication::removeLibraryPath(p); - } -#endif - // tell the cmake library where cmake is QDir cmExecDir(QApplication::applicationDirPath()); #if defined(Q_OS_MAC) diff --git a/Source/QtDialog/QCMake.cxx b/Source/QtDialog/QCMake.cxx index 776af81..a631404 100644 --- a/Source/QtDialog/QCMake.cxx +++ b/Source/QtDialog/QCMake.cxx @@ -340,11 +340,7 @@ void QCMake::interrupt() bool QCMake::interruptCallback() { -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) - return this->InterruptFlag; -#else return this->InterruptFlag.load(); -#endif } void QCMake::progressCallback(const std::string& msg, float percent) diff --git a/Source/QtDialog/QCMakeCacheView.cxx b/Source/QtDialog/QCMakeCacheView.cxx index 40cc89c..9b8c84b 100644 --- a/Source/QtDialog/QCMakeCacheView.cxx +++ b/Source/QtDialog/QCMakeCacheView.cxx @@ -155,11 +155,7 @@ QModelIndex QCMakeCacheView::moveCursor(CursorAction act, void QCMakeCacheView::setShowAdvanced(bool s) { -#if QT_VERSION >= 040300 - // new 4.3 API that needs to be called. what about an older Qt? this->SearchFilter->invalidate(); -#endif - this->AdvancedFilter->setShowAdvanced(s); } @@ -209,9 +205,7 @@ void QCMakeCacheModel::clear() void QCMakeCacheModel::setProperties(const QCMakePropertyList& props) { -#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0) this->beginResetModel(); -#endif QSet newProps; QSet newProps2; @@ -321,11 +315,7 @@ void QCMakeCacheModel::setProperties(const QCMakePropertyList& props) } this->blockSignals(b); -#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0) this->endResetModel(); -#else - this->reset(); -#endif } QCMakeCacheModel::ViewType QCMakeCacheModel::viewType() const @@ -335,9 +325,7 @@ QCMakeCacheModel::ViewType QCMakeCacheModel::viewType() const void QCMakeCacheModel::setViewType(QCMakeCacheModel::ViewType t) { -#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0) this->beginResetModel(); -#endif this->View = t; @@ -354,11 +342,7 @@ void QCMakeCacheModel::setViewType(QCMakeCacheModel::ViewType t) this->setProperties(oldProps); this->setProperties(props); this->blockSignals(b); -#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0) this->endResetModel(); -#else - this->reset(); -#endif } void QCMakeCacheModel::setPropertyData(const QModelIndex& idx1, @@ -484,8 +468,7 @@ QCMakePropertyList QCMakeCacheModel::properties() const // go to the next in the tree while (!idxs.isEmpty() && ( -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) && \ - QT_VERSION < QT_VERSION_CHECK(5, 1, 0) +#if QT_VERSION < QT_VERSION_CHECK(5, 1, 0) (idxs.last().row() + 1) >= rowCount(idxs.last().parent()) || #endif !idxs.last().sibling(idxs.last().row() + 1, 0).isValid())) { @@ -645,20 +628,6 @@ bool QCMakeCacheModelDelegate::editorEvent(QEvent* e, return success; } -// Issue 205903 fixed in Qt 4.5.0. -// Can remove this function and FileDialogFlag when minimum Qt version is 4.5 -bool QCMakeCacheModelDelegate::eventFilter(QObject* object, QEvent* evt) -{ - // workaround for what looks like a bug in Qt on macOS - // where it doesn't create a QWidget wrapper for the native file dialog - // so the Qt library ends up assuming the focus was lost to something else - - if (evt->type() == QEvent::FocusOut && this->FileDialogFlag) { - return false; - } - return QItemDelegate::eventFilter(object, evt); -} - void QCMakeCacheModelDelegate::setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const diff --git a/Source/QtDialog/QCMakeCacheView.h b/Source/QtDialog/QCMakeCacheView.h index bea1965..a252708 100644 --- a/Source/QtDialog/QCMakeCacheView.h +++ b/Source/QtDialog/QCMakeCacheView.h @@ -144,7 +144,6 @@ public: bool editorEvent(QEvent* event, QAbstractItemModel* model, const QStyleOptionViewItem& option, const QModelIndex& index); - bool eventFilter(QObject* object, QEvent* event); void setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const; QSize sizeHint(const QStyleOptionViewItem& option, -- cgit v0.12 From 4037beb7477590569ef5290f34103a7015450fe0 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Mon, 1 Jun 2020 11:40:01 -0400 Subject: QtDialog: remove Qt4 definition --- Source/QtDialog/CMakeLists.txt | 3 --- 1 file changed, 3 deletions(-) diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt index e1da7c6..e6d6b17 100644 --- a/Source/QtDialog/CMakeLists.txt +++ b/Source/QtDialog/CMakeLists.txt @@ -16,9 +16,6 @@ if(WIN32) endif() endif() -# 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}") if(CMake_QT_STATIC_QXcbIntegrationPlugin_LIBRARIES) -- cgit v0.12