]> Nutra Git (v2) - gamesguru/feather.git/commitdiff
cmake: drop support for Qt 5
authortobtoht <tob@featherwallet.org>
Thu, 12 Oct 2023 22:12:42 +0000 (00:12 +0200)
committertobtoht <tob@featherwallet.org>
Thu, 12 Oct 2023 22:12:42 +0000 (00:12 +0200)
src/CMakeLists.txt
src/SendWidget.cpp
src/components.cpp
src/components.h
src/libwalletqt/TransactionHistory.cpp
src/main.cpp

index fdad5df2433812611685e9036ebb7876a89ac179..479d4ab96f67dd05ce55c7937dca6320e534b814 100644 (file)
@@ -9,6 +9,7 @@ set(QT_COMPONENTS
         Network
         Svg
         WebSockets
+        SvgWidgets
 )
 
 if (WITH_SCANNER)
@@ -17,10 +18,7 @@ if (WITH_SCANNER)
             MultimediaWidgets)
 endif()
 
-find_package(Qt6 COMPONENTS ${QT_COMPONENTS} SvgWidgets)
-if (NOT Qt6_FOUND)
-    find_package(Qt5 5.15 REQUIRED COMPONENTS ${QT_COMPONENTS})
-endif()
+find_package(Qt6 REQUIRED COMPONENTS ${QT_COMPONENTS})
 
 set(QAPPLICATION_CLASS QApplication CACHE STRING "Inheritance class for SingleApplication")
 add_subdirectory(third-party/singleapplication)
@@ -85,7 +83,7 @@ if (WITH_SCANNER)
             "qrcode/utils/*.cpp")
 endif()
 
-if (WITH_SCANNER AND Qt6_FOUND)
+if (WITH_SCANNER)
     file(GLOB SCANNER_FILES
             "qrcode/scanner/*.h"
             "qrcode/scanner/*.cpp")
@@ -185,7 +183,7 @@ if(XMRIG)
     target_compile_definitions(feather PRIVATE HAS_XMRIG=1)
 endif()
 
-if(WITH_SCANNER AND Qt6_FOUND)
+if(WITH_SCANNER)
     target_compile_definitions(feather PRIVATE WITH_SCANNER=1)
 endif()
 
@@ -248,6 +246,7 @@ target_link_libraries(feather
         Qt::Network
         Qt::Svg
         Qt::WebSockets
+        Qt::SvgWidgets
         Threads::Threads
         ${QRENCODE_LIBRARY}
         ${POLYSEED_LIBRARY}
@@ -265,10 +264,6 @@ if(DEPENDS)
     target_link_libraries(feather ${ICONV_LIBRARIES})
 endif()
 
-if(Qt6_FOUND)
-    target_link_libraries(feather Qt::SvgWidgets)
-endif()
-
 if(DEVICE_TREZOR_READY)
     target_link_libraries(feather ${TREZOR_DEP_LIBS})
 endif()
@@ -281,15 +276,7 @@ if (WITH_SCANNER)
     )
 endif()
 
-if(UNIX AND NOT APPLE AND STATIC AND NOT Qt6_FOUND)
-    target_link_libraries(feather
-            Qt5::QSvgIconPlugin
-            Qt5::QSvgPlugin
-            Qt5::QXcbIntegrationPlugin
-    )
-endif()
-
-if(STATIC AND UNIX AND NOT APPLE AND Qt6_FOUND)
+if(STATIC AND UNIX AND NOT APPLE)
     target_link_libraries(feather Qt6::QComposePlatformInputContextPlugin)
 endif()
 
index 21d1fd6d5477753be5f7a5052a786d3616b71462..0896dcfb4994452048fa2140a3988a27fe2cf4ff 100644 (file)
@@ -120,18 +120,7 @@ void SendWidget::fillAddress(const QString &address) {
 }
 
 void SendWidget::scanClicked() {
-#if defined(WITH_SCANNER) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
-    auto cameras = QCameraInfo::availableCameras();
-    if (cameras.count() < 1) {
-        Utils::showError(this, "Can't open QR scanner", "No available cameras found");
-        return;
-    }
-
-    auto *dialog = new QrCodeScanDialog(this);
-    dialog->exec();
-    ui->lineAddress->setText(dialog->decodedString);
-    dialog->deleteLater();
-#elif defined(WITH_SCANNER)
+#if defined(WITH_SCANNER)
     auto cameras = QMediaDevices::videoInputs();
     if (cameras.empty()) {
         Utils::showError(this, "Can't open QR scanner", "No available cameras found");
index d1eb4bc4d708d3b95a58ccf5eca6e2066eb4ce69..54c685adb1679f6fbed2b865bc41dfd4f5263d6e 100644 (file)
@@ -52,11 +52,7 @@ void HelpLabel::mouseReleaseEvent(QMouseEvent *event)
     Utils::showInfo(this, m_text, m_informativeText, {}, m_doc);
 }
 
-#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);
index ce180c68cf500d22748ef21fa1f9cf2cc310eea8..851cdf3221276fa82ef8c93c85cd0555524f0667 100644 (file)
@@ -49,11 +49,7 @@ 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;
 
 private:
index e9fa983bb9cb17951054d12a012dc83a30d207f7..2a5877e6f2ce34bdf8f667dea2b90329c9ea3064 100644 (file)
@@ -45,11 +45,7 @@ TransactionInfo* TransactionHistory::transaction(int index)
 
 void TransactionHistory::refresh(quint32 accountIndex)
 {
-#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
     QDateTime firstDateTime = QDate(2014, 4, 18).startOfDay();
-#else
-    QDateTime firstDateTime = QDateTime(QDate(2014, 4, 18)); // the genesis block
-#endif
     QDateTime lastDateTime  = QDateTime::currentDateTime().addDays(1); // tomorrow (guard against jitter and timezones)
 
     emit refreshStarted();
index 71cf064e14371287baee73a543a8942dd202464a..da90b57a6b0892804f427418d8c43605ac107258 100644 (file)
@@ -125,10 +125,6 @@ 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);