From 39f663aaaa9b5e48974a60fcc11d35eb35f47d60 Mon Sep 17 00:00:00 2001 From: tooomm Date: Sat, 4 Apr 2026 12:10:03 +0200 Subject: [PATCH] min Qt 6.4 --- .ci/compile.sh | 2 ++ CMakeLists.txt | 5 +++-- .../card_picture_loader/card_picture_loader.cpp | 6 ------ .../src/interface/widgets/dialogs/dlg_settings.cpp | 10 ---------- .../interface/widgets/server/chat_view/chat_view.cpp | 10 ---------- servatrice/src/smtp/qxthmac.cpp | 4 ---- 6 files changed, 5 insertions(+), 32 deletions(-) diff --git a/.ci/compile.sh b/.ci/compile.sh index 424527f96..6e24d2560 100755 --- a/.ci/compile.sh +++ b/.ci/compile.sh @@ -168,6 +168,8 @@ if [[ $RUNNER_OS == macOS ]]; then # we use find to get the first subfolder with the name "macos" # this works independent of the qt version as there should be only one version installed on the runner at a time export QTDIR + # Add QTDIR to CMAKE_PREFIX_PATH so CMake can find Qt6 + export CMAKE_PREFIX_PATH="$QTDIR:$CMAKE_PREFIX_PATH" if [[ $TARGET_MACOS_VERSION ]]; then # CMAKE_OSX_DEPLOYMENT_TARGET is a vanilla cmake flag needed to compile to target macOS version diff --git a/CMakeLists.txt b/CMakeLists.txt index e98196673..e4c7bcecf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -195,6 +195,8 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") add_definitions("-DSFMT_MEXP=19937") endif() +find_package(Qt6 6.4 REQUIRED) + find_package(Threads REQUIRED) # Determine 32 or 64 bit build @@ -360,7 +362,6 @@ if(TEST) add_subdirectory(tests) endif() -if(Qt6_FOUND AND Qt6_VERSION_MINOR GREATER_EQUAL 3) - # Qt6.3+ requires project finalization to support translations +if(Qt6_FOUND) qt6_finalize_project() endif() diff --git a/cockatrice/src/interface/card_picture_loader/card_picture_loader.cpp b/cockatrice/src/interface/card_picture_loader/card_picture_loader.cpp index 06a0476c9..0314ee167 100644 --- a/cockatrice/src/interface/card_picture_loader/card_picture_loader.cpp +++ b/cockatrice/src/interface/card_picture_loader/card_picture_loader.cpp @@ -221,13 +221,7 @@ bool CardPictureLoader::hasCustomArt() // Check if there is at least one non-directory file in the pics path, other // than in the "downloadedPics" subdirectory. while (it.hasNext()) { -#if (QT_VERSION >= QT_VERSION_CHECK(6, 3, 0)) QFileInfo dir(it.nextFileInfo()); -#else - // nextFileInfo() is only available in Qt 6.3+, for previous versions, we build - // the QFileInfo from a QString which requires more system calls. - QFileInfo dir(it.next()); -#endif if (it.fileName() == "downloadedPics") continue; diff --git a/cockatrice/src/interface/widgets/dialogs/dlg_settings.cpp b/cockatrice/src/interface/widgets/dialogs/dlg_settings.cpp index e3bf209dc..a98f42d1a 100644 --- a/cockatrice/src/interface/widgets/dialogs/dlg_settings.cpp +++ b/cockatrice/src/interface/widgets/dialogs/dlg_settings.cpp @@ -1441,12 +1441,7 @@ MessagesSettingsPage::MessagesSettingsPage() void MessagesSettingsPage::updateColor(const QString &value) { -#if (QT_VERSION >= QT_VERSION_CHECK(6, 4, 0)) QColor colorToSet = QColor::fromString("#" + value); -#else - QColor colorToSet; - colorToSet.setNamedColor("#" + value); -#endif if (colorToSet.isValid()) { SettingsCache::instance().setChatMentionColor(value); updateMentionPreview(); @@ -1455,12 +1450,7 @@ void MessagesSettingsPage::updateColor(const QString &value) void MessagesSettingsPage::updateHighlightColor(const QString &value) { -#if (QT_VERSION >= QT_VERSION_CHECK(6, 4, 0)) QColor colorToSet = QColor::fromString("#" + value); -#else - QColor colorToSet; - colorToSet.setNamedColor("#" + value); -#endif if (colorToSet.isValid()) { SettingsCache::instance().setChatHighlightColor(value); updateHighlightPreview(); diff --git a/cockatrice/src/interface/widgets/server/chat_view/chat_view.cpp b/cockatrice/src/interface/widgets/server/chat_view/chat_view.cpp index 314ba5140..700264adb 100644 --- a/cockatrice/src/interface/widgets/server/chat_view/chat_view.cpp +++ b/cockatrice/src/interface/widgets/server/chat_view/chat_view.cpp @@ -517,23 +517,13 @@ void ChatView::showSystemPopup(const QString &userName) QColor ChatView::getCustomMentionColor() { -#if (QT_VERSION >= QT_VERSION_CHECK(6, 4, 0)) QColor customColor = QColor::fromString("#" + SettingsCache::instance().getChatMentionColor()); -#else - QColor customColor; - customColor.setNamedColor("#" + SettingsCache::instance().getChatMentionColor()); -#endif return customColor.isValid() ? customColor : DEFAULT_MENTION_COLOR; } QColor ChatView::getCustomHighlightColor() { -#if (QT_VERSION >= QT_VERSION_CHECK(6, 4, 0)) QColor customColor = QColor::fromString("#" + SettingsCache::instance().getChatMentionColor()); -#else - QColor customColor; - customColor.setNamedColor("#" + SettingsCache::instance().getChatMentionColor()); -#endif return customColor.isValid() ? customColor : DEFAULT_MENTION_COLOR; } diff --git a/servatrice/src/smtp/qxthmac.cpp b/servatrice/src/smtp/qxthmac.cpp index 3b7489f72..744977a0c 100644 --- a/servatrice/src/smtp/qxthmac.cpp +++ b/servatrice/src/smtp/qxthmac.cpp @@ -167,11 +167,7 @@ bool QxtHmac::verify(const QByteArray& otherInner) void QxtHmac::addData(const char* data, int length) { Q_ASSERT(qxt_d().opad.size()); -#if (QT_VERSION >= QT_VERSION_CHECK(6, 3, 0)) qxt_d().ihash->addData(QByteArrayView(data, length)); -#else - qxt_d().ihash->addData(data, length); -#endif qxt_d().result.clear(); }