From 2bce45260ccca602db2eba8853dca1d810f0e805 Mon Sep 17 00:00:00 2001 From: Evil Eye Date: Sat, 5 Jul 2025 14:06:56 +0200 Subject: [PATCH] Drop support for Qt5 --- .gitlab-ci.yml | 56 +++++++++---------- CI/before_script.msvc.sh | 13 ++--- CI/install_debian_deps.sh | 30 +++++----- CMakeLists.txt | 8 +-- apps/launcher/importpage.cpp | 4 -- apps/launcher/maindialog.cpp | 4 -- apps/opencs/CMakeLists.txt | 6 +- apps/opencs/model/filter/textnode.cpp | 6 +- apps/opencs/model/filter/valuenode.cpp | 4 +- .../model/prefs/shortcuteventhandler.cpp | 35 +++++------- .../model/prefs/shortcuteventhandler.hpp | 6 +- apps/opencs/model/prefs/shortcutmanager.cpp | 9 +-- apps/opencs/model/prefs/state.cpp | 7 --- apps/opencs/view/doc/view.cpp | 4 -- apps/opencs/view/filter/editwidget.hpp | 2 +- apps/opencs/view/render/instancemode.cpp | 2 +- apps/opencs/view/render/scenewidget.cpp | 8 +-- apps/opencs/view/render/scenewidget.hpp | 2 +- apps/opencs/view/render/terrainshapemode.cpp | 2 +- .../opencs/view/render/terraintexturemode.cpp | 2 +- apps/opencs/view/render/worldspacewidget.cpp | 27 ++++----- apps/opencs/view/render/worldspacewidget.hpp | 2 - apps/opencs/view/tools/reporttable.cpp | 2 +- apps/opencs/view/widget/colorpickerpopup.cpp | 2 +- apps/opencs/view/widget/completerpopup.cpp | 6 +- apps/opencs/view/world/dialoguesubview.cpp | 2 +- apps/opencs/view/world/dragrecordtable.cpp | 4 +- apps/opencs/view/world/regionmap.cpp | 4 +- apps/opencs/view/world/scriptedit.cpp | 6 +- apps/opencs/view/world/table.cpp | 4 +- .../world/tableheadermouseeventhandler.cpp | 2 +- apps/opencs/view/world/util.cpp | 6 +- components/config/gamesettings.cpp | 5 -- components/l10n/qttranslations.cpp | 4 -- components/misc/utf8qtextstream.hpp | 7 --- extern/osgQt/CMakeLists.txt | 6 +- 36 files changed, 112 insertions(+), 187 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 48d9f5ff8a..94e8866a40 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -27,14 +27,14 @@ variables: .Ubuntu_Image: tags: - saas-linux-medium-amd64 - image: ubuntu:22.04 + image: ubuntu:24.04 rules: - if: $CI_PIPELINE_SOURCE == "push" || $CI_PIPELINE_SOURCE == "merge_request_event" Ubuntu_GCC_preprocess: extends: .Ubuntu_Image cache: - key: Ubuntu_GCC_preprocess.ubuntu_22.04.v1 + key: Ubuntu_GCC_preprocess.ubuntu_24.04.v1 paths: - apt-cache/ - .cache/pip/ @@ -43,7 +43,7 @@ Ubuntu_GCC_preprocess: PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip" before_script: - CI/install_debian_deps.sh openmw-deps openmw-deps-dynamic gcc_preprocess - - pip3 install --user click termtables + - pip3 install --user --break-system-packages click termtables script: - CI/ubuntu_gcc_preprocess.sh rules: @@ -97,12 +97,12 @@ Ubuntu_GCC_preprocess: Coverity: tags: - saas-linux-medium-amd64 - image: ubuntu:22.04 + image: ubuntu:24.04 stage: build rules: - if: $CI_PIPELINE_SOURCE == "schedule" cache: - key: Coverity.ubuntu_22.04.v1 + key: Coverity.ubuntu_24.04.v1 paths: - apt-cache/ - ccache/ @@ -141,7 +141,7 @@ Coverity: Ubuntu_GCC: extends: .Ubuntu cache: - key: Ubuntu_GCC.ubuntu_22.04.v1 + key: Ubuntu_GCC.ubuntu_24.04.v1 before_script: - CI/install_debian_deps.sh gcc openmw-deps openmw-deps-dynamic variables: @@ -154,7 +154,7 @@ Ubuntu_GCC: Ubuntu_GCC_asan: extends: Ubuntu_GCC cache: - key: Ubuntu_GCC_asan.ubuntu_22.04.v1 + key: Ubuntu_GCC_asan.ubuntu_24.04.v1 variables: CMAKE_BUILD_TYPE: Debug CMAKE_CXX_FLAGS_DEBUG: -g -O1 -fno-omit-frame-pointer -fsanitize=address -fsanitize=pointer-subtract -fsanitize=leak @@ -167,7 +167,7 @@ Clang_Format: extends: .Ubuntu_Image stage: checks cache: - key: Ubuntu_Clang_Format.ubuntu_22.04.v1 + key: Ubuntu_Clang_Format.ubuntu_24.04.v1 paths: - apt-cache/ variables: @@ -183,11 +183,11 @@ Lupdate: extends: .Ubuntu_Image stage: checks cache: - key: Ubuntu_lupdate.ubuntu_22.04.v1 + key: Ubuntu_lupdate.ubuntu_24.04.v1 paths: - apt-cache/ variables: - LUPDATE: lupdate + LUPDATE: /usr/lib/qt6/bin/lupdate before_script: - CI/install_debian_deps.sh openmw-qt-translations script: @@ -209,7 +209,7 @@ Teal: Ubuntu_GCC_Debug: extends: .Ubuntu cache: - key: Ubuntu_GCC_Debug.ubuntu_22.04.v2 + key: Ubuntu_GCC_Debug.ubuntu_24.04.v2 before_script: - CI/install_debian_deps.sh gcc openmw-deps openmw-deps-dynamic variables: @@ -225,7 +225,7 @@ Ubuntu_GCC_Debug: Ubuntu_GCC_tests: extends: Ubuntu_GCC cache: - key: Ubuntu_GCC_tests.ubuntu_22.04.v1 + key: Ubuntu_GCC_tests.ubuntu_24.04.v1 variables: CCACHE_SIZE: 1G BUILD_TESTS_ONLY: 1 @@ -239,7 +239,7 @@ Ubuntu_GCC_tests: .Ubuntu_GCC_tests_Debug: extends: Ubuntu_GCC cache: - key: Ubuntu_GCC_tests_Debug.ubuntu_22.04.v1 + key: Ubuntu_GCC_tests_Debug.ubuntu_24.04.v1 variables: CCACHE_SIZE: 1G BUILD_TESTS_ONLY: 1 @@ -255,7 +255,7 @@ Ubuntu_GCC_tests: Ubuntu_GCC_tests_asan: extends: Ubuntu_GCC cache: - key: Ubuntu_GCC_tests_asan.ubuntu_22.04.v1 + key: Ubuntu_GCC_tests_asan.ubuntu_24.04.v1 variables: CCACHE_SIZE: 1G BUILD_TESTS_ONLY: 1 @@ -278,7 +278,7 @@ Ubuntu_GCC_tests_asan: Ubuntu_GCC_tests_ubsan: extends: Ubuntu_GCC cache: - key: Ubuntu_GCC_tests_ubsan.ubuntu_22.04.v1 + key: Ubuntu_GCC_tests_ubsan.ubuntu_24.04.v1 variables: CCACHE_SIZE: 1G BUILD_TESTS_ONLY: 1 @@ -298,7 +298,7 @@ Ubuntu_GCC_tests_ubsan: .Ubuntu_GCC_tests_tsan: extends: Ubuntu_GCC cache: - key: Ubuntu_GCC_tests_tsan.ubuntu_22.04.v1 + key: Ubuntu_GCC_tests_tsan.ubuntu_24.04.v1 variables: CCACHE_SIZE: 1G BUILD_TESTS_ONLY: 1 @@ -316,7 +316,7 @@ Ubuntu_GCC_tests_ubsan: Ubuntu_GCC_tests_coverage: extends: .Ubuntu_GCC_tests_Debug cache: - key: Ubuntu_GCC_tests_coverage.ubuntu_22.04.v1 + key: Ubuntu_GCC_tests_coverage.ubuntu_24.04.v1 variables: BUILD_WITH_CODE_COVERAGE: 1 before_script: @@ -345,7 +345,7 @@ Ubuntu_GCC_tests_coverage: - "CI/**/*" - ".gitlab-ci.yml" cache: - key: Ubuntu_Static_Deps.ubuntu_22.04.v1 + key: Ubuntu_Static_Deps.ubuntu_24.04.v1 paths: - apt-cache/ - ccache/ @@ -362,7 +362,7 @@ Ubuntu_GCC_tests_coverage: .Ubuntu_Static_Deps_tests: extends: .Ubuntu_Static_Deps cache: - key: Ubuntu_Static_Deps_tests.ubuntu_22.04.v1 + key: Ubuntu_Static_Deps_tests.ubuntu_24.04.v1 variables: CCACHE_SIZE: 1G BUILD_TESTS_ONLY: 1 @@ -381,7 +381,7 @@ Ubuntu_Clang: before_script: - CI/install_debian_deps.sh clang openmw-deps openmw-deps-dynamic cache: - key: Ubuntu_Clang.ubuntu_22.04.v2 + key: Ubuntu_Clang.ubuntu_24.04.v2 variables: CC: clang CXX: clang++ @@ -394,7 +394,7 @@ Ubuntu_Clang: before_script: - CI/install_debian_deps.sh clang clang-tidy openmw-deps openmw-deps-dynamic cache: - key: Ubuntu_Clang_Tidy.ubuntu_22.04.v1 + key: Ubuntu_Clang_Tidy.ubuntu_24.04.v1 variables: CMAKE_BUILD_TYPE: Debug CMAKE_CXX_FLAGS_DEBUG: -O0 @@ -451,7 +451,7 @@ Ubuntu_Clang_Tidy_other: .Ubuntu_Clang_tests: extends: Ubuntu_Clang cache: - key: Ubuntu_Clang_tests.ubuntu_22.04.v1 + key: Ubuntu_Clang_tests.ubuntu_24.04.v1 variables: CCACHE_SIZE: 1G BUILD_TESTS_ONLY: 1 @@ -465,7 +465,7 @@ Ubuntu_Clang_Tidy_other: Ubuntu_Clang_tests_Debug: extends: Ubuntu_Clang cache: - key: Ubuntu_Clang_tests_Debug.ubuntu_22.04.v1 + key: Ubuntu_Clang_tests_Debug.ubuntu_24.04.v1 variables: CCACHE_SIZE: 1G BUILD_TESTS_ONLY: 1 @@ -489,7 +489,7 @@ Ubuntu_Clang_tests_Debug: - apt-cache/ before_script: - CI/install_debian_deps.sh $OPENMW_DEPS - - pip3 install --user numpy matplotlib termtables click + - pip3 install --user --break-system-packages numpy matplotlib termtables click script: - CI/run_integration_tests.sh after_script: @@ -500,7 +500,7 @@ Ubuntu_Clang_integration_tests: needs: - Ubuntu_Clang cache: - key: Ubuntu_Clang_integration_tests.ubuntu_22.04.v2 + key: Ubuntu_Clang_integration_tests.ubuntu_24.04.v2 variables: OPENMW_DEPS: openmw-integration-tests @@ -509,9 +509,9 @@ Ubuntu_GCC_integration_tests_asan: needs: - Ubuntu_GCC_asan cache: - key: Ubuntu_GCC_integration_tests_asan.ubuntu_22.04.v1 + key: Ubuntu_GCC_integration_tests_asan.ubuntu_24.04.v1 variables: - OPENMW_DEPS: openmw-integration-tests libasan6 + OPENMW_DEPS: openmw-integration-tests libasan ASAN_OPTIONS: halt_on_error=1:strict_string_checks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1:detect_leaks=0 .MacOS: @@ -990,7 +990,7 @@ Windows_MSBuild_CacheInit: paths: - .cache/pip before_script: - - pip3 install --user requests click discord_webhook + - pip3 install --user --break-system-packages requests click discord_webhook script: - scripts/find_missing_merge_requests.py --project_id=$CI_PROJECT_ID --ignored_mrs_path=$CI_PROJECT_DIR/.resubmitted_merge_requests.txt diff --git a/CI/before_script.msvc.sh b/CI/before_script.msvc.sh index 9363211e9a..4f62ef03d9 100644 --- a/CI/before_script.msvc.sh +++ b/CI/before_script.msvc.sh @@ -708,17 +708,12 @@ printf "Qt ${QT_VER}... " DLLSUFFIX="" fi - if [ "${QT_MAJOR_VER}" -eq 6 ]; then - add_runtime_dlls $CONFIGURATION "$(pwd)/bin/Qt${QT_MAJOR_VER}"{Core,Gui,Network,OpenGL,OpenGLWidgets,Widgets,Svg}${DLLSUFFIX}.dll + add_runtime_dlls $CONFIGURATION "$(pwd)/bin/Qt${QT_MAJOR_VER}"{Core,Gui,Network,OpenGL,OpenGLWidgets,Widgets,Svg}${DLLSUFFIX}.dll - # Since Qt 6.7.0 plugin is called "qmodernwindowsstyle" - if [ "${QT_MINOR_VER}" -ge 7 ]; then - add_qt_style_dlls $CONFIGURATION "$(pwd)/plugins/styles/qmodernwindowsstyle${DLLSUFFIX}.dll" - else - add_qt_style_dlls $CONFIGURATION "$(pwd)/plugins/styles/qwindowsvistastyle${DLLSUFFIX}.dll" - fi + # Since Qt 6.7.0 plugin is called "qmodernwindowsstyle" + if [ "${QT_MINOR_VER}" -ge 7 ]; then + add_qt_style_dlls $CONFIGURATION "$(pwd)/plugins/styles/qmodernwindowsstyle${DLLSUFFIX}.dll" else - add_runtime_dlls $CONFIGURATION "$(pwd)/bin/Qt${QT_MAJOR_VER}"{Core,Gui,Network,OpenGL,Widgets,Svg}${DLLSUFFIX}.dll add_qt_style_dlls $CONFIGURATION "$(pwd)/plugins/styles/qwindowsvistastyle${DLLSUFFIX}.dll" fi diff --git a/CI/install_debian_deps.sh b/CI/install_debian_deps.sh index 3ba66133ca..79e759b871 100755 --- a/CI/install_debian_deps.sh +++ b/CI/install_debian_deps.sh @@ -33,10 +33,10 @@ declare -rA GROUPED_DEPS=( libboost-system-dev libboost-iostreams-dev libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libswresample-dev - libsdl2-dev libqt5opengl5-dev qttools5-dev qttools5-dev-tools libopenal-dev + libsdl2-dev libqt6opengl6-dev qt6-tools-dev qt6-tools-dev-tools libopenal-dev libunshield-dev libtinyxml-dev libbullet-dev liblz4-dev libpng-dev libjpeg-dev libluajit-5.1-dev librecast-dev libsqlite3-dev ca-certificates libicu-dev - libyaml-cpp-dev libqt5svg5 libqt5svg5-dev + libyaml-cpp-dev libqt6svg6 libqt6svg6-dev " # These dependencies can alternatively be built and linked statically. @@ -64,15 +64,15 @@ declare -rA GROUPED_DEPS=( gdb git git-lfs - libavcodec58 - libavformat58 - libavutil56 - libboost-iostreams1.74.0 - libboost-program-options1.74.0 - libboost-system1.74.0 + libavcodec60 + libavformat60 + libavutil58 + libboost-iostreams1.83.0 + libboost-program-options1.83.0 + libboost-system1.83.0 libbullet3.24 libcollada-dom2.5-dp0 - libicu70 + libicu74 libjpeg8 libluajit-5.1-2 liblz4-1 @@ -80,19 +80,19 @@ declare -rA GROUPED_DEPS=( libopenal1 libopenscenegraph161 libpng16-16 - libqt5opengl5 + libqt6opengl6 librecast1 libsdl2-2.0-0 libsqlite3-0 - libswresample3 - libswscale5 + libswresample4 + libswscale7 libtinyxml2.6.2v5 libyaml-cpp0.8 python3-pip xvfb " - [libasan6]="libasan6" + [libasan]="libasan8" [android]="binutils build-essential cmake ccache curl unzip git pkg-config" @@ -102,8 +102,8 @@ declare -rA GROUPED_DEPS=( " [openmw-qt-translations]=" - qttools5-dev - qttools5-dev-tools + qt6-tools-dev + qt6-tools-dev-tools git-core " ) diff --git a/CMakeLists.txt b/CMakeLists.txt index 78d9aae646..c062949ec4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -249,12 +249,8 @@ endif() find_package(LZ4 REQUIRED) if (USE_QT) - find_package(QT REQUIRED COMPONENTS Core NAMES Qt6 Qt5) - if (QT_VERSION_MAJOR VERSION_EQUAL 5) - find_package(Qt5 5.15 COMPONENTS Core Widgets Network OpenGL LinguistTools Svg REQUIRED) - else() - find_package(Qt6 COMPONENTS Core Widgets Network OpenGL OpenGLWidgets LinguistTools Svg REQUIRED) - endif() + find_package(QT REQUIRED COMPONENTS Core NAMES Qt6) + find_package(Qt6 COMPONENTS Core Widgets Network OpenGL OpenGLWidgets LinguistTools Svg REQUIRED) message(STATUS "Using Qt${QT_VERSION}") endif() diff --git a/apps/launcher/importpage.cpp b/apps/launcher/importpage.cpp index 3ad6e538da..461ba4c2eb 100644 --- a/apps/launcher/importpage.cpp +++ b/apps/launcher/importpage.cpp @@ -88,11 +88,7 @@ void Launcher::ImportPage::on_importerButton_clicked() // Create the file if it doesn't already exist, else the importer will fail auto path = mCfgMgr.getUserConfigPath(); path /= "openmw.cfg"; -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) QFile file(path); -#else - QFile file(Files::pathToQString(path)); -#endif if (!file.exists()) { diff --git a/apps/launcher/maindialog.cpp b/apps/launcher/maindialog.cpp index 07face085f..2aa80d346c 100644 --- a/apps/launcher/maindialog.cpp +++ b/apps/launcher/maindialog.cpp @@ -497,11 +497,7 @@ bool Launcher::MainDialog::writeSettings() } // Game settings -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) QFile file(userPath / Files::openmwCfgFile); -#else - QFile file(Files::getUserConfigPathQString(mCfgMgr)); -#endif if (!file.open(QIODevice::ReadWrite | QIODevice::Text)) { diff --git a/apps/opencs/CMakeLists.txt b/apps/opencs/CMakeLists.txt index 0a278316e3..c9ca7838be 100644 --- a/apps/opencs/CMakeLists.txt +++ b/apps/opencs/CMakeLists.txt @@ -240,11 +240,7 @@ target_link_libraries(openmw-cs-lib components_qt ) -if (QT_VERSION_MAJOR VERSION_EQUAL 6) - target_link_libraries(openmw-cs-lib Qt::Widgets Qt::Core Qt::Network Qt::OpenGL Qt::OpenGLWidgets Qt::Svg) -else() - target_link_libraries(openmw-cs-lib Qt::Widgets Qt::Core Qt::Network Qt::OpenGL Qt::Svg) -endif() +target_link_libraries(openmw-cs-lib Qt::Widgets Qt::Core Qt::Network Qt::OpenGL Qt::OpenGLWidgets Qt::Svg) if (WIN32) target_sources(openmw-cs PRIVATE ${CMAKE_SOURCE_DIR}/files/windows/openmw-cs.exe.manifest) diff --git a/apps/opencs/model/filter/textnode.cpp b/apps/opencs/model/filter/textnode.cpp index 7d837f9e54..e8b89c5277 100644 --- a/apps/opencs/model/filter/textnode.cpp +++ b/apps/opencs/model/filter/textnode.cpp @@ -34,11 +34,11 @@ bool CSMFilter::TextNode::test(const CSMWorld::IdTableBase& table, int row, cons QString string; - if (data.type() == QVariant::String) + if (data.typeId() == QMetaType::QString) { string = data.toString(); } - else if ((data.type() == QVariant::Int || data.type() == QVariant::UInt) + else if ((data.typeId() == QMetaType::Int || data.typeId() == QMetaType::UInt) && CSMWorld::Columns::hasEnums(static_cast(mColumnId))) { int value = data.toInt(); @@ -49,7 +49,7 @@ bool CSMFilter::TextNode::test(const CSMWorld::IdTableBase& table, int row, cons if (value >= 0 && value < static_cast(enums.size())) string = QString::fromUtf8(enums[value].second.c_str()); } - else if (data.type() == QVariant::Bool) + else if (data.typeId() == QMetaType::Bool) { string = data.toBool() ? "true" : "false"; } diff --git a/apps/opencs/model/filter/valuenode.cpp b/apps/opencs/model/filter/valuenode.cpp index 264967f240..abbf00aecd 100644 --- a/apps/opencs/model/filter/valuenode.cpp +++ b/apps/opencs/model/filter/valuenode.cpp @@ -29,8 +29,8 @@ bool CSMFilter::ValueNode::test(const CSMWorld::IdTableBase& table, int row, con QVariant data = table.data(index); - if (data.type() != QVariant::Double && data.type() != QVariant::Bool && data.type() != QVariant::Int - && data.type() != QVariant::UInt && data.type() != static_cast(QMetaType::Float)) + if (data.typeId() != QMetaType::Double && data.typeId() != QMetaType::Bool && data.typeId() != QMetaType::Int + && data.typeId() != QMetaType::UInt && data.typeId() != QMetaType::Float) return false; double value = data.toDouble(); diff --git a/apps/opencs/model/prefs/shortcuteventhandler.cpp b/apps/opencs/model/prefs/shortcuteventhandler.cpp index 4bbda2996f..a7e9dfbb3a 100644 --- a/apps/opencs/model/prefs/shortcuteventhandler.cpp +++ b/apps/opencs/model/prefs/shortcuteventhandler.cpp @@ -62,39 +62,31 @@ namespace CSMPrefs { QWidget* widget = static_cast(watched); QKeyEvent* keyEvent = static_cast(event); - unsigned int mod = (unsigned int)keyEvent->modifiers(); - unsigned int key = (unsigned int)keyEvent->key(); if (!keyEvent->isAutoRepeat()) - return activate(widget, mod, key); + return activate(widget, keyEvent->keyCombination()); } else if (event->type() == QEvent::KeyRelease) { QWidget* widget = static_cast(watched); QKeyEvent* keyEvent = static_cast(event); - unsigned int mod = (unsigned int)keyEvent->modifiers(); - unsigned int key = (unsigned int)keyEvent->key(); if (!keyEvent->isAutoRepeat()) - return deactivate(widget, mod, key); + return deactivate(widget, keyEvent->keyCombination()); } else if (event->type() == QEvent::MouseButtonPress) { QWidget* widget = static_cast(watched); QMouseEvent* mouseEvent = static_cast(event); - unsigned int mod = (unsigned int)mouseEvent->modifiers(); - unsigned int button = (unsigned int)mouseEvent->button(); - return activate(widget, mod, button); + return activate(widget, QKeyCombination(mouseEvent->modifiers(), Qt::Key(mouseEvent->button()))); } else if (event->type() == QEvent::MouseButtonRelease) { QWidget* widget = static_cast(watched); QMouseEvent* mouseEvent = static_cast(event); - unsigned int mod = (unsigned int)mouseEvent->modifiers(); - unsigned int button = (unsigned int)mouseEvent->button(); - return deactivate(widget, mod, button); + return deactivate(widget, QKeyCombination(mouseEvent->modifiers(), Qt::Key(mouseEvent->button()))); } else if (event->type() == QEvent::FocusOut) { @@ -149,7 +141,7 @@ namespace CSMPrefs } } - bool ShortcutEventHandler::activate(QWidget* widget, unsigned int mod, unsigned int button) + bool ShortcutEventHandler::activate(QWidget* widget, QKeyCombination keyCombination) { std::vector> potentials; bool used = false; @@ -167,7 +159,7 @@ namespace CSMPrefs if (!shortcut->isEnabled()) continue; - if (checkModifier(mod, button, shortcut, true)) + if (checkModifier(keyCombination, shortcut, true)) used = true; if (shortcut->getActivationStatus() != Shortcut::AS_Inactive) @@ -175,7 +167,8 @@ namespace CSMPrefs int pos = shortcut->getPosition(); int lastPos = shortcut->getLastPosition(); - MatchResult result = match(mod, button, shortcut->getSequence()[pos]); + MatchResult result = match(keyCombination.keyboardModifiers(), keyCombination.key(), + shortcut->getSequence()[pos].toCombined()); if (result == Matches_WithMod || result == Matches_NoMod) { @@ -220,10 +213,8 @@ namespace CSMPrefs return used; } - bool ShortcutEventHandler::deactivate(QWidget* widget, unsigned int mod, unsigned int button) + bool ShortcutEventHandler::deactivate(QWidget* widget, QKeyCombination keyCombination) { - const int KeyMask = 0x01FFFFFF; - bool used = false; while (widget) @@ -235,11 +226,11 @@ namespace CSMPrefs { Shortcut* shortcut = *it; - if (checkModifier(mod, button, shortcut, false)) + if (checkModifier(keyCombination, shortcut, false)) used = true; int pos = shortcut->getPosition(); - MatchResult result = match(0, button, shortcut->getSequence()[pos] & KeyMask); + MatchResult result = match(0, keyCombination.key(), shortcut->getSequence()[pos].key()); if (result != Matches_Not) { @@ -268,13 +259,13 @@ namespace CSMPrefs return used; } - bool ShortcutEventHandler::checkModifier(unsigned int mod, unsigned int button, Shortcut* shortcut, bool activate) + bool ShortcutEventHandler::checkModifier(QKeyCombination keyCombination, Shortcut* shortcut, bool activate) { if (!shortcut->isEnabled() || !shortcut->getModifier() || shortcut->getSecondaryMode() == Shortcut::SM_Ignore || shortcut->getModifierStatus() == activate) return false; - MatchResult result = match(mod, button, shortcut->getModifier()); + MatchResult result = match(keyCombination.keyboardModifiers(), keyCombination.key(), shortcut->getModifier()); bool used = false; if (result != Matches_Not) diff --git a/apps/opencs/model/prefs/shortcuteventhandler.hpp b/apps/opencs/model/prefs/shortcuteventhandler.hpp index 2093e259e9..cc94797450 100644 --- a/apps/opencs/model/prefs/shortcuteventhandler.hpp +++ b/apps/opencs/model/prefs/shortcuteventhandler.hpp @@ -42,11 +42,11 @@ namespace CSMPrefs void updateParent(QWidget* widget); - bool activate(QWidget* widget, unsigned int mod, unsigned int button); + bool activate(QWidget* widget, QKeyCombination keyCombination); - bool deactivate(QWidget* widget, unsigned int mod, unsigned int button); + bool deactivate(QWidget* widget, QKeyCombination keyCombination); - bool checkModifier(unsigned int mod, unsigned int button, Shortcut* shortcut, bool activate); + bool checkModifier(QKeyCombination keyCombination, Shortcut* shortcut, bool activate); MatchResult match(unsigned int mod, unsigned int button, unsigned int value); diff --git a/apps/opencs/model/prefs/shortcutmanager.cpp b/apps/opencs/model/prefs/shortcutmanager.cpp index ac032efffb..2ffa042641 100644 --- a/apps/opencs/model/prefs/shortcutmanager.cpp +++ b/apps/opencs/model/prefs/shortcutmanager.cpp @@ -115,15 +115,12 @@ namespace CSMPrefs std::string ShortcutManager::convertToString(const QKeySequence& sequence) const { - const int MouseKeyMask = 0x01FFFFFF; - const int ModMask = 0x7E000000; - std::string result; - for (int i = 0; i < (int)sequence.count(); ++i) + for (int i = 0; i < sequence.count(); ++i) { - int mods = sequence[i] & ModMask; - int key = sequence[i] & MouseKeyMask; + int mods = sequence[i].keyboardModifiers(); + int key = sequence[i].key(); if (key) { diff --git a/apps/opencs/model/prefs/state.cpp b/apps/opencs/model/prefs/state.cpp index b80d150448..4d191b90a4 100644 --- a/apps/opencs/model/prefs/state.cpp +++ b/apps/opencs/model/prefs/state.cpp @@ -59,13 +59,6 @@ void CSMPrefs::State::declare() .setTooltip("Minimum width of subviews.") .setRange(50, 10000); declareEnum(mValues->mWindows.mMainwindowScrollbar, "Main Window Horizontal Scrollbar Mode"); -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - declareBool(mValues->mWindows.mGrowLimit, "Grow Limit Screen") - .setTooltip( - "When \"Grow then Scroll\" option is selected, the window size grows to" - " the width of the virtual desktop. \nIf this option is selected the the window growth" - "is limited to the current screen."); -#endif declareCategory("Records"); declareEnum(mValues->mRecords.mStatusFormat, "Modification Status Display Format"); diff --git a/apps/opencs/view/doc/view.cpp b/apps/opencs/view/doc/view.cpp index afcab50ead..ffc7400da3 100644 --- a/apps/opencs/view/doc/view.cpp +++ b/apps/opencs/view/doc/view.cpp @@ -659,11 +659,7 @@ void CSVDoc::View::addSubView(const CSMWorld::UniversalId& id, const std::string // mScrollbarOnly = windows["mainwindow-scrollbar"].toString() == "Scrollbar Only"; -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - updateWidth(windows["grow-limit"].isTrue(), minWidth); -#else updateWidth(true, minWidth); -#endif mSubViewWindow.addDockWidget(Qt::TopDockWidgetArea, view); diff --git a/apps/opencs/view/filter/editwidget.hpp b/apps/opencs/view/filter/editwidget.hpp index f2ecd5f642..7efbd8e7a3 100644 --- a/apps/opencs/view/filter/editwidget.hpp +++ b/apps/opencs/view/filter/editwidget.hpp @@ -50,7 +50,7 @@ namespace CSVFilter std::pair operator()(const QVariant& variantData) { FilterType filterType = FilterType::String; - QMetaType::Type dataType = static_cast(variantData.type()); + QMetaType::Type dataType = static_cast(variantData.typeId()); if (dataType == QMetaType::QString || dataType == QMetaType::Bool || dataType == QMetaType::Int) filterType = FilterType::String; if (dataType == QMetaType::Int || dataType == QMetaType::Float) diff --git a/apps/opencs/view/render/instancemode.cpp b/apps/opencs/view/render/instancemode.cpp index 76cfd57ba6..e100a69a7c 100644 --- a/apps/opencs/view/render/instancemode.cpp +++ b/apps/opencs/view/render/instancemode.cpp @@ -1132,7 +1132,7 @@ void CSVRender::InstanceMode::dropEvent(QDropEvent* event) return; WorldspaceHitResult hit - = getWorldspaceWidget().mousePick(event->pos(), getWorldspaceWidget().getInteractionMask()); + = getWorldspaceWidget().mousePick(event->position().toPoint(), getWorldspaceWidget().getInteractionMask()); std::string cellId = getWorldspaceWidget().getCellId(hit.worldPos); diff --git a/apps/opencs/view/render/scenewidget.cpp b/apps/opencs/view/render/scenewidget.cpp index e84433f14c..5e8db03cf8 100644 --- a/apps/opencs/view/render/scenewidget.cpp +++ b/apps/opencs/view/render/scenewidget.cpp @@ -161,8 +161,6 @@ namespace CSVRender , mLighting(nullptr) , mHasDefaultAmbient(false) , mIsExterior(true) - , mPrevMouseX(0) - , mPrevMouseY(0) , mCamPositionSet(false) { mFreeCamControl = new FreeCameraController(this); @@ -423,10 +421,10 @@ namespace CSVRender void SceneWidget::mouseMoveEvent(QMouseEvent* event) { - mCurrentCamControl->handleMouseMoveEvent(event->x() - mPrevMouseX, event->y() - mPrevMouseY); + QPointF pos = event->position(); + mCurrentCamControl->handleMouseMoveEvent(pos.x() - mPrevMouse.x(), pos.y() - mPrevMouse.y()); - mPrevMouseX = event->x(); - mPrevMouseY = event->y(); + mPrevMouse = pos; } void SceneWidget::wheelEvent(QWheelEvent* event) diff --git a/apps/opencs/view/render/scenewidget.hpp b/apps/opencs/view/render/scenewidget.hpp index aeec5d191c..2e9526eff6 100644 --- a/apps/opencs/view/render/scenewidget.hpp +++ b/apps/opencs/view/render/scenewidget.hpp @@ -137,7 +137,7 @@ namespace CSVRender LightingNight mLightingNight; LightingBright mLightingBright; - int mPrevMouseX, mPrevMouseY; + QPointF mPrevMouse; /// Tells update that camera isn't set bool mCamPositionSet; diff --git a/apps/opencs/view/render/terrainshapemode.cpp b/apps/opencs/view/render/terrainshapemode.cpp index bc1c6c6365..4f8bd44f05 100644 --- a/apps/opencs/view/render/terrainshapemode.cpp +++ b/apps/opencs/view/render/terrainshapemode.cpp @@ -1661,7 +1661,7 @@ void CSVRender::TerrainShapeMode::dragMoveEvent(QDragMoveEvent* event) {} void CSVRender::TerrainShapeMode::mouseMoveEvent(QMouseEvent* event) { - WorldspaceHitResult hit = getWorldspaceWidget().mousePick(event->pos(), getInteractionMask()); + WorldspaceHitResult hit = getWorldspaceWidget().mousePick(event->position().toPoint(), getInteractionMask()); if (hit.hit && mBrushDraw && !(mShapeEditTool == ShapeEditTool_Drag && mIsEditing)) mBrushDraw->update(hit.worldPos, mBrushSize, mBrushShape); if (!hit.hit && mBrushDraw && !(mShapeEditTool == ShapeEditTool_Drag && mIsEditing)) diff --git a/apps/opencs/view/render/terraintexturemode.cpp b/apps/opencs/view/render/terraintexturemode.cpp index cfc7f50cf1..b3fd64705d 100644 --- a/apps/opencs/view/render/terraintexturemode.cpp +++ b/apps/opencs/view/render/terraintexturemode.cpp @@ -724,7 +724,7 @@ void CSVRender::TerrainTextureMode::dragMoveEvent(QDragMoveEvent* event) {} void CSVRender::TerrainTextureMode::mouseMoveEvent(QMouseEvent* event) { - WorldspaceHitResult hit = getWorldspaceWidget().mousePick(event->pos(), getInteractionMask()); + WorldspaceHitResult hit = getWorldspaceWidget().mousePick(event->position().toPoint(), getInteractionMask()); if (hit.hit && mBrushDraw) mBrushDraw->update(hit.worldPos, mBrushSize, mBrushShape); if (!hit.hit && mBrushDraw) diff --git a/apps/opencs/view/render/worldspacewidget.cpp b/apps/opencs/view/render/worldspacewidget.cpp index 915282ab45..6254017ec2 100644 --- a/apps/opencs/view/render/worldspacewidget.cpp +++ b/apps/opencs/view/render/worldspacewidget.cpp @@ -687,11 +687,12 @@ void CSVRender::WorldspaceWidget::mouseMoveEvent(QMouseEvent* event) if (mDragging) { - int diffX = event->x() - mDragX; - int diffY = (height() - event->y()) - mDragY; + QPoint pos = event->position().toPoint(); + int diffX = pos.x() - mDragX; + int diffY = (height() - pos.y()) - mDragY; - mDragX = event->x(); - mDragY = height() - event->y(); + mDragX = pos.x(); + mDragY = height() - pos.y(); double factor = mDragFactor; @@ -700,32 +701,32 @@ void CSVRender::WorldspaceWidget::mouseMoveEvent(QMouseEvent* event) EditMode& editMode = dynamic_cast(*mEditMode->getCurrent()); - editMode.drag(event->pos(), diffX, diffY, factor); + editMode.drag(event->position().toPoint(), diffX, diffY, factor); } else if (mDragMode != InteractionType_None) { EditMode& editMode = dynamic_cast(*mEditMode->getCurrent()); if (mDragMode == InteractionType_PrimaryEdit) - mDragging = editMode.primaryEditStartDrag(event->pos()); + mDragging = editMode.primaryEditStartDrag(event->position().toPoint()); else if (mDragMode == InteractionType_SecondaryEdit) - mDragging = editMode.secondaryEditStartDrag(event->pos()); + mDragging = editMode.secondaryEditStartDrag(event->position().toPoint()); else if (mDragMode == InteractionType_PrimarySelect) - mDragging = editMode.primarySelectStartDrag(event->pos()); + mDragging = editMode.primarySelectStartDrag(event->position().toPoint()); else if (mDragMode == InteractionType_SecondarySelect) - mDragging = editMode.secondarySelectStartDrag(event->pos()); + mDragging = editMode.secondarySelectStartDrag(event->position().toPoint()); if (mDragging) { - mDragX = event->localPos().x(); - mDragY = height() - event->localPos().y(); + mDragX = event->position().x(); + mDragY = height() - event->position().y(); } } else { - if (event->globalPos() != mToolTipPos) + if (event->globalPosition().toPoint() != mToolTipPos) { - mToolTipPos = event->globalPos(); + mToolTipPos = event->globalPosition().toPoint(); if (mShowToolTips) { diff --git a/apps/opencs/view/render/worldspacewidget.hpp b/apps/opencs/view/render/worldspacewidget.hpp index a223a54388..831ed13640 100644 --- a/apps/opencs/view/render/worldspacewidget.hpp +++ b/apps/opencs/view/render/worldspacewidget.hpp @@ -260,8 +260,6 @@ namespace CSVRender void settingChanged(const CSMPrefs::Setting* setting) override; - bool getSpeedMode(); - void cycleNavigationMode(); private: diff --git a/apps/opencs/view/tools/reporttable.cpp b/apps/opencs/view/tools/reporttable.cpp index 7ec55b96b5..8c92d9980f 100644 --- a/apps/opencs/view/tools/reporttable.cpp +++ b/apps/opencs/view/tools/reporttable.cpp @@ -93,7 +93,7 @@ void CSVTools::ReportTable::contextMenuEvent(QContextMenuEvent* event) void CSVTools::ReportTable::mouseMoveEvent(QMouseEvent* event) { if (event->buttons() & Qt::LeftButton) - startDragFromTable(*this, indexAt(event->pos())); + startDragFromTable(*this, indexAt(event->position().toPoint())); } void CSVTools::ReportTable::mouseDoubleClickEvent(QMouseEvent* event) diff --git a/apps/opencs/view/widget/colorpickerpopup.cpp b/apps/opencs/view/widget/colorpickerpopup.cpp index 87c62e137b..0918e798a5 100644 --- a/apps/opencs/view/widget/colorpickerpopup.cpp +++ b/apps/opencs/view/widget/colorpickerpopup.cpp @@ -52,7 +52,7 @@ void CSVWidget::ColorPickerPopup::mousePressEvent(QMouseEvent* event) // If the mouse is pressed above the pop-up parent, // the pop-up will be hidden and the pressed signal won't be repeated for the parent - if (buttonRect.contains(event->globalPos()) || buttonRect.contains(event->pos())) + if (buttonRect.contains(event->globalPosition().toPoint()) || buttonRect.contains(event->position().toPoint())) { setAttribute(Qt::WA_NoMouseReplay); } diff --git a/apps/opencs/view/widget/completerpopup.cpp b/apps/opencs/view/widget/completerpopup.cpp index 91b0902659..25daee1f1f 100644 --- a/apps/opencs/view/widget/completerpopup.cpp +++ b/apps/opencs/view/widget/completerpopup.cpp @@ -22,12 +22,8 @@ int CSVWidget::CompleterPopup::sizeHintForRow(int row) const ensurePolished(); QModelIndex index = model()->index(row, modelColumn()); -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) QStyleOptionViewItem option; initViewItemOption(&option); -#else - QStyleOptionViewItem option = viewOptions(); -#endif - QAbstractItemDelegate* delegate = itemDelegate(index); + QAbstractItemDelegate* delegate = itemDelegateForIndex(index); return delegate->sizeHint(option, index).height(); } diff --git a/apps/opencs/view/world/dialoguesubview.cpp b/apps/opencs/view/world/dialoguesubview.cpp index 168e555eae..ac69805134 100644 --- a/apps/opencs/view/world/dialoguesubview.cpp +++ b/apps/opencs/view/world/dialoguesubview.cpp @@ -85,7 +85,7 @@ void CSVWorld::NotEditableSubDelegate::setEditorData(QWidget* editor, const QMod CSMWorld::Columns::ColumnId columnId = static_cast(mTable->getColumnId(index.column())); - if (QVariant::String == v.type()) + if (QMetaType::QString == v.typeId()) { label->setText(v.toString()); } diff --git a/apps/opencs/view/world/dragrecordtable.cpp b/apps/opencs/view/world/dragrecordtable.cpp index a006779ba4..adff809335 100644 --- a/apps/opencs/view/world/dragrecordtable.cpp +++ b/apps/opencs/view/world/dragrecordtable.cpp @@ -55,7 +55,7 @@ void CSVWorld::DragRecordTable::dragEnterEvent(QDragEnterEvent* event) void CSVWorld::DragRecordTable::dragMoveEvent(QDragMoveEvent* event) { - QModelIndex index = indexAt(event->pos()); + QModelIndex index = indexAt(event->position().toPoint()); if (CSVWorld::DragDropUtils::canAcceptData(*event, getIndexDisplayType(index)) || CSVWorld::DragDropUtils::isInfo(*event, getIndexDisplayType(index)) || CSVWorld::DragDropUtils::isTopicOrJournal(*event, getIndexDisplayType(index))) @@ -71,7 +71,7 @@ void CSVWorld::DragRecordTable::dragMoveEvent(QDragMoveEvent* event) void CSVWorld::DragRecordTable::dropEvent(QDropEvent* event) { - QModelIndex index = indexAt(event->pos()); + QModelIndex index = indexAt(event->position().toPoint()); CSMWorld::ColumnBase::Display display = getIndexDisplayType(index); if (CSVWorld::DragDropUtils::canAcceptData(*event, display)) { diff --git a/apps/opencs/view/world/regionmap.cpp b/apps/opencs/view/world/regionmap.cpp index 17d0016afc..ae9ac94022 100644 --- a/apps/opencs/view/world/regionmap.cpp +++ b/apps/opencs/view/world/regionmap.cpp @@ -341,7 +341,7 @@ void CSVWorld::RegionMap::viewInTable() void CSVWorld::RegionMap::mouseMoveEvent(QMouseEvent* event) { - startDragFromTable(*this, indexAt(event->pos())); + startDragFromTable(*this, indexAt(event->position().toPoint())); } std::vector CSVWorld::RegionMap::getDraggedRecords() const @@ -376,7 +376,7 @@ void CSVWorld::RegionMap::dragMoveEvent(QDragMoveEvent* event) void CSVWorld::RegionMap::dropEvent(QDropEvent* event) { - QModelIndex index = indexAt(event->pos()); + QModelIndex index = indexAt(event->position().toPoint()); bool exists = QTableView::model()->data(index, Qt::BackgroundRole) != QBrush(Qt::DiagCrossPattern); if (!index.isValid() || !exists) diff --git a/apps/opencs/view/world/scriptedit.cpp b/apps/opencs/view/world/scriptedit.cpp index 00acf71235..2871e0ced1 100644 --- a/apps/opencs/view/world/scriptedit.cpp +++ b/apps/opencs/view/world/scriptedit.cpp @@ -136,7 +136,7 @@ void CSVWorld::ScriptEdit::dragEnterEvent(QDragEnterEvent* event) QPlainTextEdit::dragEnterEvent(event); else { - setTextCursor(cursorForPosition(event->pos())); + setTextCursor(cursorForPosition(event->position().toPoint())); event->acceptProposedAction(); } } @@ -148,7 +148,7 @@ void CSVWorld::ScriptEdit::dragMoveEvent(QDragMoveEvent* event) QPlainTextEdit::dragMoveEvent(event); else { - setTextCursor(cursorForPosition(event->pos())); + setTextCursor(cursorForPosition(event->position().toPoint())); event->accept(); } } @@ -162,7 +162,7 @@ void CSVWorld::ScriptEdit::dropEvent(QDropEvent* event) return; } - setTextCursor(cursorForPosition(event->pos())); + setTextCursor(cursorForPosition(event->position().toPoint())); if (mime->fromDocument(mDocument)) { diff --git a/apps/opencs/view/world/table.cpp b/apps/opencs/view/world/table.cpp index 86a1e93bbd..2cadbf289a 100644 --- a/apps/opencs/view/world/table.cpp +++ b/apps/opencs/view/world/table.cpp @@ -592,7 +592,7 @@ void CSVWorld::Table::moveRecords(QDropEvent* event) if (mEditLock || (mModel->getFeatures() & CSMWorld::IdTableBase::Feature_Constant)) return; - QModelIndex targedIndex = indexAt(event->pos()); + QModelIndex targedIndex = indexAt(event->position().toPoint()); QModelIndexList selectedRows = selectionModel()->selectedRows(); int targetRowRaw = targedIndex.row(); @@ -872,7 +872,7 @@ void CSVWorld::Table::mouseMoveEvent(QMouseEvent* event) { if (event->buttons() & Qt::LeftButton) { - startDragFromTable(*this, indexAt(event->pos())); + startDragFromTable(*this, indexAt(event->position().toPoint())); } } diff --git a/apps/opencs/view/world/tableheadermouseeventhandler.cpp b/apps/opencs/view/world/tableheadermouseeventhandler.cpp index dcd2e659a6..2bc6c4fe00 100644 --- a/apps/opencs/view/world/tableheadermouseeventhandler.cpp +++ b/apps/opencs/view/world/tableheadermouseeventhandler.cpp @@ -31,7 +31,7 @@ namespace CSVWorld auto& clickEvent = static_cast(*event); if ((clickEvent.button() == Qt::MiddleButton)) { - const auto& index = table.indexAt(clickEvent.pos()); + const auto& index = table.indexAt(clickEvent.position().toPoint()); table.setColumnHidden(index.column(), true); clickEvent.accept(); return true; diff --git a/apps/opencs/view/world/util.cpp b/apps/opencs/view/world/util.cpp index dfb587cd96..39b8ba321e 100644 --- a/apps/opencs/view/world/util.cpp +++ b/apps/opencs/view/world/util.cpp @@ -171,7 +171,7 @@ QWidget* CSVWorld::CommandDelegate::createEditor( // TODO: Find a better solution? if (display == CSMWorld::ColumnBase::Display_Boolean) { - return QItemEditorFactory::defaultFactory()->createEditor(QVariant::Bool, parent); + return QItemEditorFactory::defaultFactory()->createEditor(QMetaType::Bool, parent); } // For tables the pop-up of the color editor should appear immediately after the editor creation // (the third parameter of ColorEditor's constructor) @@ -362,11 +362,7 @@ void CSVWorld::CommandDelegate::setEditorData(QWidget* editor, const QModelIndex if (!n.isEmpty()) { if (!variant.isValid()) -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) variant = QVariant(editor->property(n).metaType(), (const void*)nullptr); -#else - variant = QVariant(editor->property(n).userType(), (const void*)nullptr); -#endif editor->setProperty(n, variant); } } diff --git a/components/config/gamesettings.cpp b/components/config/gamesettings.cpp index 7f022bb653..f5d9918c10 100644 --- a/components/config/gamesettings.cpp +++ b/components/config/gamesettings.cpp @@ -25,11 +25,6 @@ namespace Config::GameSettings::GameSettings(const Files::ConfigurationManager& cfg) : mCfgMgr(cfg) { -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - // this needs calling once so Qt can see its stream operators, which it needs when dragging and dropping - // it's automatic with Qt 6 - qRegisterMetaTypeStreamOperators("Config::SettingValue"); -#endif } void Config::GameSettings::validatePaths() diff --git a/components/l10n/qttranslations.cpp b/components/l10n/qttranslations.cpp index 1051b3dd2d..fbc38dc122 100644 --- a/components/l10n/qttranslations.cpp +++ b/components/l10n/qttranslations.cpp @@ -14,11 +14,7 @@ namespace L10n // Try to load OpenMW translations from resources folder first. // If we loaded them, try to load Qt translations from both // resources folder and default translations folder as well. -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) auto qtPath = QLibraryInfo::path(QLibraryInfo::TranslationsPath); -#else - auto qtPath = QLibraryInfo::location(QLibraryInfo::TranslationsPath); -#endif auto localPath = resourcesPath + "/translations"; if (AppTranslator.load(QLocale::system(), appName, "_", localPath) diff --git a/components/misc/utf8qtextstream.hpp b/components/misc/utf8qtextstream.hpp index a1e101864f..1b8bd1d786 100644 --- a/components/misc/utf8qtextstream.hpp +++ b/components/misc/utf8qtextstream.hpp @@ -3,20 +3,13 @@ #include -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) -#include -#endif #include namespace Misc { inline void ensureUtf8Encoding(QTextStream& stream) { -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - stream.setCodec(QTextCodec::codecForName("UTF-8")); -#else stream.setEncoding(QStringConverter::Utf8); -#endif } } #endif diff --git a/extern/osgQt/CMakeLists.txt b/extern/osgQt/CMakeLists.txt index 781305ca47..1cfb8230a3 100644 --- a/extern/osgQt/CMakeLists.txt +++ b/extern/osgQt/CMakeLists.txt @@ -17,11 +17,7 @@ set(OSGQT_SOURCE_FILES add_library(${OSGQT_LIBRARY} STATIC ${OSGQT_SOURCE_FILES}) -if (QT_VERSION_MAJOR VERSION_EQUAL 6) - target_link_libraries(${OSGQT_LIBRARY} Qt::Core Qt::OpenGL Qt::OpenGLWidgets) -else() - target_link_libraries(${OSGQT_LIBRARY} Qt::Core Qt::OpenGL) -endif() +target_link_libraries(${OSGQT_LIBRARY} Qt::Core Qt::OpenGL Qt::OpenGLWidgets) link_directories(${CMAKE_CURRENT_BINARY_DIR})