From 49c9c15d6c84fe1860e48eac79691d0500c3b05f Mon Sep 17 00:00:00 2001 From: tobtoht Date: Tue, 24 May 2022 15:18:43 +0200 Subject: [PATCH 01/18] Qt6: fix QSvgWidget include --- src/CoinsWidget.h | 2 +- src/ReceiveWidget.h | 2 +- src/dialog/TxInfoDialog.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/CoinsWidget.h b/src/CoinsWidget.h index f0978d7d..bb45e744 100644 --- a/src/CoinsWidget.h +++ b/src/CoinsWidget.h @@ -6,7 +6,7 @@ #include #include -#include +#include #include "appcontext.h" #include "model/CoinsModel.h" diff --git a/src/ReceiveWidget.h b/src/ReceiveWidget.h index 05e7ae05..9bd19e0f 100644 --- a/src/ReceiveWidget.h +++ b/src/ReceiveWidget.h @@ -6,7 +6,7 @@ #include #include -#include +#include #include "appcontext.h" #include "libwalletqt/Subaddress.h" diff --git a/src/dialog/TxInfoDialog.h b/src/dialog/TxInfoDialog.h index 61234dec..e00381f8 100644 --- a/src/dialog/TxInfoDialog.h +++ b/src/dialog/TxInfoDialog.h @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include "appcontext.h" #include "dialog/TxProofDialog.h" From 4cd7c868ad9970e97d296e89b33cdaa14e8f24d6 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Tue, 24 May 2022 16:01:24 +0200 Subject: [PATCH 02/18] Qt6: fix obsolete QPalette value --- src/utils/ColorScheme.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/ColorScheme.cpp b/src/utils/ColorScheme.cpp index 6dffe26b..32e8f640 100644 --- a/src/utils/ColorScheme.cpp +++ b/src/utils/ColorScheme.cpp @@ -15,7 +15,7 @@ ColorSchemeItem ColorScheme::GRAY = ColorSchemeItem("gray", "gray"); bool ColorScheme::hasDarkBackground(QWidget *widget) { int r, g, b; - widget->palette().color(QPalette::Background).getRgb(&r, &g, &b); + widget->palette().color(QPalette::Window).getRgb(&r, &g, &b); auto brightness = r + g + b; return brightness < (255*3/2); } From 43e89fcef5af09c732c4f3504cb6e766bd8bec37 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Tue, 24 May 2022 17:15:36 +0200 Subject: [PATCH 03/18] Qt6: remove QTextCodec --- src/model/WalletKeysFilesModel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/model/WalletKeysFilesModel.cpp b/src/model/WalletKeysFilesModel.cpp index 4fe4bdcb..fd2f80b0 100644 --- a/src/model/WalletKeysFilesModel.cpp +++ b/src/model/WalletKeysFilesModel.cpp @@ -98,7 +98,7 @@ void WalletKeysFilesModel::findWallets() { if (Utils::fileExists(basePath + ".address.txt")) { QFile file(basePath + ".address.txt"); file.open(QFile::ReadOnly | QFile::Text); - const QString _address = QTextCodec::codecForMib(106)->toUnicode(file.readAll()); + const QString _address = QString::fromUtf8(file.readAll()); if (!_address.isEmpty()) { addr = _address; From a4328d07a88c63ef912cfb007ab0ea8ccb6262dd Mon Sep 17 00:00:00 2001 From: tobtoht Date: Tue, 24 May 2022 17:20:33 +0200 Subject: [PATCH 04/18] Qt6: fix missing import --- src/utils/textedit.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/utils/textedit.cpp b/src/utils/textedit.cpp index 51f2dbf2..30a74b95 100644 --- a/src/utils/textedit.cpp +++ b/src/utils/textedit.cpp @@ -55,6 +55,7 @@ #include #include #include +#include TextEdit::TextEdit(QWidget *parent) : QTextEdit(parent) { } From 80fed34d164a8a7f8a44c341deedaa5eabad81ce Mon Sep 17 00:00:00 2001 From: tobtoht Date: Tue, 24 May 2022 17:22:55 +0200 Subject: [PATCH 05/18] Qt6: use setSecsSinceEpoch --- src/utils/TxFiatHistory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/TxFiatHistory.cpp b/src/utils/TxFiatHistory.cpp index 725cbc18..6736de08 100644 --- a/src/utils/TxFiatHistory.cpp +++ b/src/utils/TxFiatHistory.cpp @@ -14,7 +14,7 @@ TxFiatHistory::TxFiatHistory(int genesis_timestamp, const QString &configDirecto double TxFiatHistory::get(int timestamp) { QDateTime ts; - ts.setTime_t(timestamp); + ts.setSecsSinceEpoch(timestamp); auto key = ts.toString("yyyyMMdd"); return this->get(key); // USD } From d7c4717092211f9a427419671c5bb3eb15cdf793 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Tue, 24 May 2022 17:24:24 +0200 Subject: [PATCH 06/18] Qt6: .toObject() --- src/model/LocalMoneroModel.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/model/LocalMoneroModel.cpp b/src/model/LocalMoneroModel.cpp index ca74eb61..7a8e95fa 100644 --- a/src/model/LocalMoneroModel.cpp +++ b/src/model/LocalMoneroModel.cpp @@ -156,8 +156,8 @@ void LocalMoneroModel::setPaymentMethods(const QJsonObject &data) { m_paymentMethods = data; m_paymentMethodNames.clear(); for (const auto &payment_method : data) { - auto code = payment_method["code"].toString(); - auto name = payment_method["name"].toString(); + auto code = payment_method.toObject()["code"].toString(); + auto name = payment_method.toObject()["name"].toString(); if (!code.isEmpty() && !name.isEmpty()) { m_paymentMethodNames[code] = name; From 97bb165ae294d2b05a00a778a3cdb82b246363aa Mon Sep 17 00:00:00 2001 From: tobtoht Date: Tue, 24 May 2022 17:26:35 +0200 Subject: [PATCH 07/18] Qt6: use toSecsSinceEpoch --- src/libwalletqt/TransactionHistory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libwalletqt/TransactionHistory.cpp b/src/libwalletqt/TransactionHistory.cpp index 66352826..b6aacc2f 100644 --- a/src/libwalletqt/TransactionHistory.cpp +++ b/src/libwalletqt/TransactionHistory.cpp @@ -202,7 +202,7 @@ bool TransactionHistory::writeCSV(const QString &path) { // format and write QString line = QString("\n%1,%2,\"%3\",%4,\"%5\",%6,%7,%8,\"%9\",\"%10\",\"%11\",%12,\"%13\"") - .arg(QString::number(info.blockHeight()), QString::number(timeStamp.toTime_t()), date, + .arg(QString::number(info.blockHeight()), QString::number(timeStamp.toSecsSinceEpoch()), date, QString::number(info.subaddrAccount()), direction, balanceDelta, info.displayAmount(), info.fee(), info.hash(), info.description(), paymentId, fiatAmount, preferredFiatSymbol); data += line; From d6f7255e3ecd7ca00da63bbbfa59cd8179cf732c Mon Sep 17 00:00:00 2001 From: tobtoht Date: Tue, 24 May 2022 17:27:39 +0200 Subject: [PATCH 08/18] Qt6: remove QTextCodec --- src/utils/Utils.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/Utils.cpp b/src/utils/Utils.cpp index 8bcba474..997fb4af 100644 --- a/src/utils/Utils.cpp +++ b/src/utils/Utils.cpp @@ -516,7 +516,7 @@ void applicationLogHandler(QtMsgType type, const QMessageLogContext &context, co } QString barrayToString(const QByteArray &data) { - return QString(QTextCodec::codecForMib(106)->toUnicode(data)); + return QString::fromUtf8(data); } QString getAccountName() { From 46d2228541d056496c438f18db777f6abd4fb0a9 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Tue, 24 May 2022 17:30:49 +0200 Subject: [PATCH 09/18] Qt6: splitRef -> split --- src/utils/Updater.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/Updater.cpp b/src/utils/Updater.cpp index 649eb6a3..138d27de 100644 --- a/src/utils/Updater.cpp +++ b/src/utils/Updater.cpp @@ -32,7 +32,7 @@ QByteArray Updater::getHash(const void *data, size_t size) const QByteArray Updater::parseShasumOutput(const QString &message, const QString &filename) const { - for (const auto &line : message.splitRef("\n")) + for (const auto &line : message.split("\n")) { const auto trimmed = line.trimmed(); if (trimmed.endsWith(filename)) From 5c1fda7310b16d290c6ecb871eac4062e64fdd80 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Tue, 24 May 2022 17:32:42 +0200 Subject: [PATCH 10/18] Qt6: QEnterEvent --- src/components.cpp | 4 ++++ src/components.h | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/components.cpp b/src/components.cpp index 5d625767..87a7eab4 100644 --- a/src/components.cpp +++ b/src/components.cpp @@ -89,7 +89,11 @@ void HelpLabel::mouseReleaseEvent(QMouseEvent *event) QMessageBox::information(this, "Help", this->help_text); } +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) void HelpLabel::enterEvent(QEvent *event) +#else +void HelpLabel::enterEvent(QEnterEvent *event) +#endif { font.setUnderline(true); setFont(font); diff --git a/src/components.h b/src/components.h index fb03aaaf..938a006d 100644 --- a/src/components.h +++ b/src/components.h @@ -102,7 +102,11 @@ public: protected: void mouseReleaseEvent(QMouseEvent *event) override; +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) void enterEvent(QEvent *event) override; +#else + void enterEvent(QEnterEvent *event) override; +#endif void leaveEvent(QEvent *event) override; }; From 9d2da9b2f0389cb51a82a8e3fd0d358a25c4fc26 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Tue, 24 May 2022 17:34:52 +0200 Subject: [PATCH 11/18] Qt6: disable some Attributes --- src/main.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index 243b3f4b..477df638 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -114,8 +114,10 @@ if (AttachConsole(ATTACH_PARENT_PROCESS)) { constants::networkType = NetworkType::MAINNET; // Setup QApplication +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QApplication::setAttribute(Qt::AA_DisableWindowContextHelpButton); +#endif QApplication::setDesktopSettingsAware(true); // use system font QApplication::setApplicationVersion(FEATHER_VERSION); From 9d5bc2b8c60551c9b9cdddd0453283300adcdd10 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Tue, 24 May 2022 17:36:42 +0200 Subject: [PATCH 12/18] Qt6: hide setupChildProcess --- src/utils/childproc.cpp | 4 +++- src/utils/childproc.h | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/utils/childproc.cpp b/src/utils/childproc.cpp index 671b1b4e..a5690601 100644 --- a/src/utils/childproc.cpp +++ b/src/utils/childproc.cpp @@ -6,9 +6,11 @@ ChildProcess::ChildProcess(QObject* parent) {} ChildProcess::~ChildProcess() {} +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) void ChildProcess::setupChildProcess() { #if defined(HAVE_SYS_PRCTL_H) && defined(Q_OS_UNIX) // https://smackerelofopinion.blogspot.com/2015/11/using-prsetpdeathsig-to-reap-child.html ::prctl(PR_SET_PDEATHSIG, SIGKILL); #endif -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/src/utils/childproc.h b/src/utils/childproc.h index 89ba2aa8..6b87e1ab 100644 --- a/src/utils/childproc.h +++ b/src/utils/childproc.h @@ -17,7 +17,9 @@ public: explicit ChildProcess(QObject* parent = nullptr); ~ChildProcess() override; protected: +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) void setupChildProcess() override; +#endif }; From db331ab9b2e5950e68b37a37482e9cede463b45a Mon Sep 17 00:00:00 2001 From: tobtoht Date: Tue, 24 May 2022 17:38:56 +0200 Subject: [PATCH 13/18] Qt6: set CXX_STANDARD --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1c758330..6572ef01 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,6 +3,9 @@ project(feather) message(STATUS "Initiating compile using CMake ${CMAKE_VERSION}") +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + set(VERSION_MAJOR "1") set(VERSION_MINOR "0") set(VERSION_REVISION "1") From d73ea2b54d89530aac587fb1edf3ac494f1b5211 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Tue, 24 May 2022 17:53:45 +0200 Subject: [PATCH 14/18] Qt6: remove hasPendingEvents --- src/MainWindow.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index c0a010bb..35b6b00c 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -1665,11 +1665,12 @@ void MainWindow::checkUserActivity() { this->setEnabled(false); this->close(); // This doesn't close the wallet immediately. - do { + // FIXME +// do { QApplication::processEvents(); // Because running it a single time is apparently not enough. // TODO: Qt bug? Need proper fix for this. - } while (QApplication::hasPendingEvents()); +// } while (QApplication::hasPendingEvents()); } else { m_checkUserActivity.start(); } From e7085b8d9ec1048e3f0b5bbe331a8cd216cf7c70 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Tue, 24 May 2022 18:02:02 +0200 Subject: [PATCH 15/18] Qt6: update CMakeLists --- src/CMakeLists.txt | 95 +++++++++++++++++++++++++--------------------- 1 file changed, 52 insertions(+), 43 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d453f930..d9d67def 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -5,30 +5,34 @@ set(CMAKE_AUTOUIC ON) # pthread find_package(Threads REQUIRED) -set(QT5_COMPONENTS +set(QT_COMPONENTS Core Widgets Gui Network Svg + SvgWidgets Xml WebSockets ) if (WITH_SCANNER) - list(APPEND QT5_COMPONENTS + list(APPEND QT_COMPONENTS Multimedia MultimediaWidgets) endif() -find_package(Qt5 REQUIRED COMPONENTS ${QT5_COMPONENTS}) +find_package(Qt6 REQUIRED COMPONENTS ${QT_COMPONENTS}) +if (NOT Qt6_FOUND) + find_package(Qt5 5.15 REQUIRED COMPONENTS ${QT_COMPONENTS}) +endif() set(QAPPLICATION_CLASS QApplication CACHE STRING "Inheritance class for SingleApplication") add_subdirectory(third-party/singleapplication) add_subdirectory(openpgp) -qt5_add_resources(RESOURCES assets.qrc assets_tor.qrc) +qt_add_resources(RESOURCES assets.qrc assets_tor.qrc) # Compile source files (.h/.cpp) file(GLOB SOURCE_FILES @@ -67,7 +71,7 @@ file(GLOB SOURCE_FILES "qrcode_scanner/QrCodeUtils.h" ) -if (WITH_SCANNER) +if (WITH_SCANNER AND NOT Qt6_FOUND) file(GLOB SCANNER_FILES "qrcode_scanner/*.h" "qrcode_scanner/*.cpp") @@ -84,8 +88,8 @@ if(MINGW) set(ICON_RC ${CMAKE_CURRENT_BINARY_DIR}/icon.rc) set(ICON_RES ${CMAKE_CURRENT_BINARY_DIR}/icon.o) file(WRITE ${ICON_RC} "IDI_ICON1 ICON DISCARDABLE \"${ICON}\"") - find_program(Qt5_WINDRES_EXECUTABLE NAMES windres x86_64-w64-mingw32-windres REQUIRED CMAKE_FIND_ROOT_PATH_BOTH) - add_custom_command(OUTPUT ${ICON_RES} COMMAND ${Qt5_WINDRES_EXECUTABLE} ${ICON_RC} ${ICON_RES} MAIN_DEPENDENCY ${ICON_RC}) + find_program(Qt_WINDRES_EXECUTABLE NAMES windres x86_64-w64-mingw32-windres REQUIRED CMAKE_FIND_ROOT_PATH_BOTH) + add_custom_command(OUTPUT ${ICON_RES} COMMAND ${Qt_WINDRES_EXECUTABLE} ${ICON_RC} ${ICON_RES} MAIN_DEPENDENCY ${ICON_RC}) list(APPEND RESOURCES ${ICON_RES}) endif() @@ -112,7 +116,7 @@ set_target_properties(feather PROPERTIES set_property(TARGET feather PROPERTY RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin") -target_include_directories(feather PUBLIC ${Qt5Gui_PRIVATE_INCLUDE_DIRS}) +target_include_directories(feather PUBLIC ${QtGui_PRIVATE_INCLUDE_DIRS}) target_include_directories(feather PUBLIC ${CMAKE_BINARY_DIR}/src/feather_autogen/include @@ -130,13 +134,14 @@ target_include_directories(feather PUBLIC ${X11_INCLUDE_DIR} ${Boost_INCLUDE_DIRS} ${OPENSSL_INCLUDE_DIR} - ${Qt5Core_INCLUDE_DIRS} - ${Qt5Widgets_INCLUDE_DIRS} - ${Qt5Gui_INCLUDE_DIRS} - ${Qt5Network_INCLUDE_DIRS} - ${Qt5Svg_INCLUDE_DIRS} - ${Qt5Xml_INCLUDE_DIRS} - ${Qt5WebSockets_INCLUDE_DIRS} + ${QtCore_INCLUDE_DIRS} + ${QtWidgets_INCLUDE_DIRS} + ${QtGui_INCLUDE_DIRS} + ${QtNetwork_INCLUDE_DIRS} + ${QtSvg_INCLUDE_DIRS} + ${QtSvgWidgets_INCLUDE_DIRS} + ${QtXml_INCLUDE_DIRS} + ${QtWebSockets_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIRS} ${LIBZIP_INCLUDE_DIRS} ${ZBAR_INCLUDE_DIR} @@ -145,8 +150,8 @@ target_include_directories(feather PUBLIC if(WITH_SCANNER) target_include_directories(feather PUBLIC - ${Qt5Multimedia_INCLUDE_DIRS} - ${Qt5MultimediaWidgets_INCLUDE_DIRS} + ${QtMultimedia_INCLUDE_DIRS} + ${QtMultimediaWidgets_INCLUDE_DIRS} ) endif() @@ -174,7 +179,7 @@ if(XMRIG) target_compile_definitions(feather PRIVATE HAS_XMRIG=1) endif() -if(WITH_SCANNER) +if(WITH_SCANNER AND NOT Qt6_FOUND) target_compile_definitions(feather PRIVATE WITH_SCANNER=1) endif() @@ -203,23 +208,24 @@ endif() target_compile_definitions(feather PUBLIC - ${Qt5Core_DEFINITIONS} - ${Qt5Widgets_DEFINITIONS} - ${Qt5Gui_DEFINITIONS} - ${Qt5Network_DEFINITIONS} - ${Qt5Svg_DEFINITIONS} - ${Qt5Xml_DEFINITIONS} - ${Qt5WebSockets_DEFINITIONS} + ${QtCore_DEFINITIONS} + ${QtWidgets_DEFINITIONS} + ${QtGui_DEFINITIONS} + ${QtNetwork_DEFINITIONS} + ${QtSvg_DEFINITIONS} + ${QtSvgWidgets_DEFINITIONS} + ${QtXml_DEFINITIONS} + ${QtWebSockets_DEFINITIONS} ) if (WITH_SCANNER) target_compile_definitions(feather PUBLIC - ${Qt5Multimedia_DEFINITIONS} - ${Qt5MultimediaWidgets_DEFINITIONS} + ${QtMultimedia_DEFINITIONS} + ${QtMultimediaWidgets_DEFINITIONS} ) endif() -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${QtWidgets_EXECUTABLE_COMPILE_FLAGS}") if(UNIX AND NOT APPLE) # https://stackoverflow.com/questions/57766620/cmake-add-library-doesnt-initialize-static-global-variable @@ -242,13 +248,14 @@ target_link_libraries(feather ${OPENSSL_LIBRARIES} ${CMAKE_DL_LIBS} ${EXTRA_LIBRARIES} - Qt5::Core - Qt5::Widgets - Qt5::Gui - Qt5::Network - Qt5::Svg - Qt5::Xml - Qt5::WebSockets + Qt::Core + Qt::Widgets + Qt::Gui + Qt::Network + Qt::Svg + Qt::SvgWidgets + Qt::Xml + Qt::WebSockets ${ICU_LIBRARIES} openpgp Threads::Threads @@ -266,25 +273,27 @@ endif() if (WITH_SCANNER) target_link_libraries(feather - Qt5::Multimedia - Qt5::MultimediaWidgets + Qt::Multimedia + Qt::MultimediaWidgets ) endif() -if(NOT APPLE) +if(NOT APPLE AND NOT Qt6_FOUND) target_link_libraries(feather - Qt5::QSvgIconPlugin - Qt5::QSvgPlugin + Qt::QSvgIconPlugin + Qt::QSvgPlugin ) endif() if(STATIC) + if(NOT Qt6_FOUND) target_link_libraries(feather - Qt5::QSvgIconPlugin - Qt5::QSvgPlugin) + Qt::QSvgIconPlugin + Qt::QSvgPlugin) + endif() if(UNIX AND NOT APPLE) target_link_libraries(feather - Qt5::QXcbIntegrationPlugin) + Qt::QXcbIntegrationPlugin) endif() endif() From 45d2dc13d47a9050dcbf1880d7be8765e3b73943 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Tue, 24 May 2022 18:04:15 +0200 Subject: [PATCH 16/18] Qt6: fix Qt5 builds --- src/CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d9d67def..b9ff8501 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -11,7 +11,6 @@ set(QT_COMPONENTS Gui Network Svg - SvgWidgets Xml WebSockets ) @@ -22,7 +21,7 @@ if (WITH_SCANNER) MultimediaWidgets) endif() -find_package(Qt6 REQUIRED COMPONENTS ${QT_COMPONENTS}) +find_package(Qt6 REQUIRED COMPONENTS ${QT_COMPONENTS} SvgWidgets) if (NOT Qt6_FOUND) find_package(Qt5 5.15 REQUIRED COMPONENTS ${QT_COMPONENTS}) endif() From f1cb266f70fbf37f2349d15b4c5fb4e9a2dfe8d1 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Tue, 24 May 2022 18:06:34 +0200 Subject: [PATCH 17/18] Qt6: fix Qt5 builds [2] --- src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b9ff8501..e3ed1697 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -21,7 +21,7 @@ if (WITH_SCANNER) MultimediaWidgets) endif() -find_package(Qt6 REQUIRED COMPONENTS ${QT_COMPONENTS} SvgWidgets) +find_package(Qt6 COMPONENTS ${QT_COMPONENTS} SvgWidgets) if (NOT Qt6_FOUND) find_package(Qt5 5.15 REQUIRED COMPONENTS ${QT_COMPONENTS}) endif() From ed048edb23a0098ccf0c66a28451c5a6e2f0ced1 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Tue, 24 May 2022 18:27:48 +0200 Subject: [PATCH 18/18] Qt6: fix Qt5 builds [3] --- src/CMakeLists.txt | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e3ed1697..651b9633 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -252,7 +252,6 @@ target_link_libraries(feather Qt::Gui Qt::Network Qt::Svg - Qt::SvgWidgets Qt::Xml Qt::WebSockets ${ICU_LIBRARIES} @@ -266,6 +265,10 @@ target_link_libraries(feather SingleApplication::SingleApplication ) +if(Qt6_FOUND) + target_link_libraries(feather Qt::SvgWidgets) +endif() + if(DEVICE_TREZOR_READY) target_link_libraries(feather ${TREZOR_DEP_LIBS}) endif() @@ -279,20 +282,20 @@ endif() if(NOT APPLE AND NOT Qt6_FOUND) target_link_libraries(feather - Qt::QSvgIconPlugin - Qt::QSvgPlugin + Qt5::QSvgIconPlugin + Qt5::QSvgPlugin ) endif() -if(STATIC) +if(STATIC AND NOT Qt6_FOUND) if(NOT Qt6_FOUND) target_link_libraries(feather - Qt::QSvgIconPlugin - Qt::QSvgPlugin) + Qt5::QSvgIconPlugin + Qt5::QSvgPlugin) endif() if(UNIX AND NOT APPLE) target_link_libraries(feather - Qt::QXcbIntegrationPlugin) + Qt5::QXcbIntegrationPlugin) endif() endif()