From: gg Date: Fri, 16 Jan 2026 02:34:27 +0000 (-0500) Subject: fixup! Qt 5.12 compat (refactor) X-Git-Url: https://git.nutra.tk/v2?a=commitdiff_plain;h=1b4d9872b26049df7069f87ca253f0d488254ddf;p=gamesguru%2Ffeather.git fixup! Qt 5.12 compat (refactor) --- diff --git a/src/libwalletqt/Wallet.cpp b/src/libwalletqt/Wallet.cpp index 0927be53..fbb36c90 100644 --- a/src/libwalletqt/Wallet.cpp +++ b/src/libwalletqt/Wallet.cpp @@ -364,7 +364,12 @@ QString Wallet::getSeed(const QString &seedOffset) const { } qsizetype Wallet::seedLength() const { +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) auto seedLength = this->getCacheAttribute("feather.seed").split(" ", Qt::SkipEmptyParts).length(); +#else + auto seedLength = this->getCacheAttribute("feather.seed").split(" ", QString::SkipEmptyParts).length(); +#endif + return seedLength ? seedLength : 25; } @@ -670,8 +675,14 @@ void Wallet::syncDateRange(const QDate &start, const QDate &end) { QString filename = Utils::getRestoreHeightFilename(static_cast(nettype)); std::unique_ptr lookup(RestoreHeightLookup::fromFile(filename, static_cast(nettype))); +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) uint64_t startHeight = lookup->dateToHeight(start.startOfDay().toSecsSinceEpoch()); uint64_t endHeight = lookup->dateToHeight(end.startOfDay().toSecsSinceEpoch()); +#else + // Legacy Qt 5.12 + uint64_t startHeight = lookup->dateToHeight(QDateTime(start, QTime(0, 0, 0)).toSecsSinceEpoch()); + uint64_t endHeight = lookup->dateToHeight(QDateTime(end, QTime(0, 0, 0)).toSecsSinceEpoch()); +#endif if (startHeight >= endHeight) return; diff --git a/src/libwalletqt/rows/ConstructionInfo.h b/src/libwalletqt/rows/ConstructionInfo.h index b88d20b2..c1a417b0 100644 --- a/src/libwalletqt/rows/ConstructionInfo.h +++ b/src/libwalletqt/rows/ConstructionInfo.h @@ -5,6 +5,7 @@ #define FEATHER_CONSTRUCTIONINFO_H #include +#include // Qt 5.12 support (Ubuntu 20.04) #include "Output.h" #include "Input.h" diff --git a/src/utils/TxFiatHistory.cpp b/src/utils/TxFiatHistory.cpp index 17f9b135..59018c66 100644 --- a/src/utils/TxFiatHistory.cpp +++ b/src/utils/TxFiatHistory.cpp @@ -4,6 +4,8 @@ #include "TxFiatHistory.h" #include +#include // For Qt5 compatibility +#include // For Qt5 compatibility #include "utils/Utils.h" diff --git a/src/utils/Utils.cpp b/src/utils/Utils.cpp index d9e42776..221d9f8b 100644 --- a/src/utils/Utils.cpp +++ b/src/utils/Utils.cpp @@ -72,7 +72,12 @@ QString loadQrc(const QString &qrc) { bool fileWrite(const QString &path, const QString &data) { QFile file(path); if (file.open(QIODevice::WriteOnly)) { - QTextStream out(&file); out << data << Qt::endl; + QTextStream out(&file); +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) + out << data << Qt::endl; +#else + out << data << endl; // Legacy Qt 5.12 uses the global/stream 'endl' +#endif file.close(); return true; } diff --git a/src/wizard/PageNetwork.cpp b/src/wizard/PageNetwork.cpp index 3ff23435..457aff1f 100644 --- a/src/wizard/PageNetwork.cpp +++ b/src/wizard/PageNetwork.cpp @@ -28,9 +28,15 @@ PageNetwork::PageNetwork(QWidget *parent) QPixmap infoIcon = QPixmap(":/assets/images/info2.svg"); ui->infoIcon->setPixmap(infoIcon.scaledToWidth(32, Qt::SmoothTransformation)); +#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) connect(ui->btnGroup_network, &QButtonGroup::idClicked, [this](int id) { +#else + // Qt 5.12: Explicitly select the 'int' overload of buttonClicked + connect(ui->btnGroup_network, QOverload::of(&QButtonGroup::buttonClicked), [this](int id) { +#endif ui->frame_customNode->setVisible(id == Button::CUSTOM); }); + connect(ui->line_customNode, &QLineEdit::textEdited, [this]{ this->completeChanged(); }); diff --git a/src/wizard/PageWalletRestoreSeed.cpp b/src/wizard/PageWalletRestoreSeed.cpp index 8023d578..03ef4cad 100644 --- a/src/wizard/PageWalletRestoreSeed.cpp +++ b/src/wizard/PageWalletRestoreSeed.cpp @@ -162,7 +162,11 @@ bool PageWalletRestoreSeed::validatePage() { seed = seed.replace("\n", " ").replace("\r", "").trimmed(); auto errStyle = "QTextEdit{border: 1px solid red;}"; +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) QStringList seedSplit = seed.split(" ", Qt::SkipEmptyParts); +#else + QStringList seedSplit = seed.split(" ", QString::SkipEmptyParts); +#endif if (seedSplit.length() != m_mode->length) { if (!(m_mode->type == Seed::Type::MONERO && seedSplit.length() == 24)) {