Modernize Qt dependency path

This commit is contained in:
root
2026-04-30 06:38:51 +00:00
parent c655e4d576
commit 49ac41045b
43 changed files with 2034 additions and 368 deletions
+17 -4
View File
@@ -58,6 +58,12 @@
#if QT_VERSION < 0x050400
Q_IMPORT_PLUGIN(AccessibleFactory)
#endif
#if defined(QT_TLS_OPENSSL)
Q_IMPORT_PLUGIN(QTlsBackendOpenSSL);
#endif
#if defined(QT_QPA_PLATFORM_MINIMAL)
Q_IMPORT_PLUGIN(QMinimalIntegrationPlugin);
#endif
#if defined(QT_QPA_PLATFORM_XCB)
Q_IMPORT_PLUGIN(QXcbIntegrationPlugin);
#elif defined(QT_QPA_PLATFORM_WINDOWS)
@@ -120,12 +126,19 @@ static void initTranslations(QTranslator& qtTranslatorBase, QTranslator& qtTrans
// - First load the translator for the base language, without territory
// - Then load the more specific locale translator
const QString qtTranslationsPath =
#if QT_VERSION >= 0x060000
QLibraryInfo::path(QLibraryInfo::TranslationsPath);
#else
QLibraryInfo::location(QLibraryInfo::TranslationsPath);
#endif
// Load e.g. qt_de.qm
if (qtTranslatorBase.load("qt_" + lang, QLibraryInfo::location(QLibraryInfo::TranslationsPath)))
if (qtTranslatorBase.load("qt_" + lang, qtTranslationsPath))
QApplication::installTranslator(&qtTranslatorBase);
// Load e.g. qt_de_DE.qm
if (qtTranslator.load("qt_" + lang_territory, QLibraryInfo::location(QLibraryInfo::TranslationsPath)))
if (qtTranslator.load("qt_" + lang_territory, qtTranslationsPath))
QApplication::installTranslator(&qtTranslator);
// Load e.g. bitcoin_de.qm (shortcut "de" needs to be defined in agrarian.qrc)
@@ -502,11 +515,11 @@ int main(int argc, char* argv[])
Q_INIT_RESOURCE(agrarian_locale);
Q_INIT_RESOURCE(agrarian);
#if QT_VERSION > 0x050100
#if QT_VERSION > 0x050100 && QT_VERSION < 0x060000
// Generate high-dpi pixmaps
QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
#endif
#if QT_VERSION >= 0x050600
#if QT_VERSION >= 0x050600 && QT_VERSION < 0x060000
QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
#endif
#ifdef Q_OS_MAC
+3 -3
View File
@@ -16,6 +16,7 @@
#include <QDebug>
#include <QList>
#include <QLocale>
bool BannedNodeLessThan::operator()(const CCombinedBan& left, const CCombinedBan& right) const
{
@@ -125,9 +126,8 @@ QVariant BanTableModel::data(const QModelIndex &index, int role) const
case Address:
return QString::fromStdString(rec->subnet.ToString());
case Bantime:
QDateTime date = QDateTime::fromMSecsSinceEpoch(0);
date = date.addSecs(rec->banEntry.nBanUntil);
return date.toString(Qt::SystemLocaleLongDate);
QDateTime date = QDateTime::fromSecsSinceEpoch(rec->banEntry.nBanUntil);
return QLocale::system().toString(date, QLocale::LongFormat);
}
}
+4 -1
View File
@@ -119,7 +119,10 @@ public:
opt.rect = rect();
cachedMinimumSizeHint = style()->sizeFromContents(QStyle::CT_SpinBox, &opt, hint, this).expandedTo(QApplication::globalStrut());
cachedMinimumSizeHint = style()->sizeFromContents(QStyle::CT_SpinBox, &opt, hint, this);
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
cachedMinimumSizeHint = cachedMinimumSizeHint.expandedTo(QApplication::globalStrut());
#endif
}
return cachedMinimumSizeHint;
}
+18 -15
View File
@@ -37,9 +37,12 @@
#include <iostream>
#include <QAction>
#include <QActionGroup>
#include <QApplication>
#include <QDateTime>
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
#include <QDesktopWidget>
#endif
#include <QDragEnterEvent>
#include <QIcon>
#include <QListWidget>
@@ -305,9 +308,9 @@ void BitcoinGUI::createActions(const NetworkStyle* networkStyle)
overviewAction->setToolTip(overviewAction->statusTip());
overviewAction->setCheckable(true);
#ifdef Q_OS_MAC
overviewAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_1));
overviewAction->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_1));
#else
overviewAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_1));
overviewAction->setShortcut(QKeySequence(Qt::ALT | Qt::Key_1));
#endif
tabGroup->addAction(overviewAction);
@@ -316,9 +319,9 @@ void BitcoinGUI::createActions(const NetworkStyle* networkStyle)
sendCoinsAction->setToolTip(sendCoinsAction->statusTip());
sendCoinsAction->setCheckable(true);
#ifdef Q_OS_MAC
sendCoinsAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_2));
sendCoinsAction->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_2));
#else
sendCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_2));
sendCoinsAction->setShortcut(QKeySequence(Qt::ALT | Qt::Key_2));
#endif
tabGroup->addAction(sendCoinsAction);
@@ -327,9 +330,9 @@ void BitcoinGUI::createActions(const NetworkStyle* networkStyle)
receiveCoinsAction->setToolTip(receiveCoinsAction->statusTip());
receiveCoinsAction->setCheckable(true);
#ifdef Q_OS_MAC
receiveCoinsAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_3));
receiveCoinsAction->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_3));
#else
receiveCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_3));
receiveCoinsAction->setShortcut(QKeySequence(Qt::ALT | Qt::Key_3));
#endif
tabGroup->addAction(receiveCoinsAction);
@@ -338,9 +341,9 @@ void BitcoinGUI::createActions(const NetworkStyle* networkStyle)
historyAction->setToolTip(historyAction->statusTip());
historyAction->setCheckable(true);
#ifdef Q_OS_MAC
historyAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_4));
historyAction->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_4));
#else
historyAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_4));
historyAction->setShortcut(QKeySequence(Qt::ALT | Qt::Key_4));
#endif
tabGroup->addAction(historyAction);
@@ -349,9 +352,9 @@ void BitcoinGUI::createActions(const NetworkStyle* networkStyle)
privacyAction->setToolTip(privacyAction->statusTip());
privacyAction->setCheckable(true);
#ifdef Q_OS_MAC
privacyAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_5));
privacyAction->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_5));
#else
privacyAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_5));
privacyAction->setShortcut(QKeySequence(Qt::ALT | Qt::Key_5));
#endif
tabGroup->addAction(privacyAction);
@@ -364,9 +367,9 @@ void BitcoinGUI::createActions(const NetworkStyle* networkStyle)
masternodeAction->setToolTip(masternodeAction->statusTip());
masternodeAction->setCheckable(true);
#ifdef Q_OS_MAC
masternodeAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_6));
masternodeAction->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_6));
#else
masternodeAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_6));
masternodeAction->setShortcut(QKeySequence(Qt::ALT | Qt::Key_6));
#endif
tabGroup->addAction(masternodeAction);
connect(masternodeAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized()));
@@ -378,9 +381,9 @@ void BitcoinGUI::createActions(const NetworkStyle* networkStyle)
governanceAction->setToolTip(governanceAction->statusTip());
governanceAction->setCheckable(true);
#ifdef Q_OS_MAC
governanceAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_7));
governanceAction->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_7));
#else
governanceAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_7));
governanceAction->setShortcut(QKeySequence(Qt::ALT | Qt::Key_7));
#endif
tabGroup->addAction(governanceAction);
@@ -401,7 +404,7 @@ void BitcoinGUI::createActions(const NetworkStyle* networkStyle)
quitAction = new QAction(QIcon(":/icons/quit"), tr("E&xit"), this);
quitAction->setStatusTip(tr("Quit application"));
quitAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q));
quitAction->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_Q));
quitAction->setMenuRole(QAction::QuitRole);
aboutAction = new QAction(networkStyle->getAppIcon(), tr("&About Agrarian Core"), this);
aboutAction->setStatusTip(tr("Show information about Agrarian Core"));
+1 -2
View File
@@ -72,8 +72,7 @@ static std::string ScriptToString(const CScript& Script, bool Long = false, bool
static std::string TimeToString(uint64_t Time)
{
QDateTime timestamp;
timestamp.setTime_t(Time);
QDateTime timestamp = QDateTime::fromSecsSinceEpoch(Time);
return timestamp.toString("yyyy-MM-dd hh:mm:ss").toUtf8().data();
}
+3 -3
View File
@@ -110,9 +110,9 @@ QDateTime ClientModel::getLastBlockDate() const
{
LOCK(cs_main);
if (chainActive.Tip())
return QDateTime::fromTime_t(chainActive.Tip()->GetBlockTime());
return QDateTime::fromSecsSinceEpoch(chainActive.Tip()->GetBlockTime());
else
return QDateTime::fromTime_t(Params().GenesisBlock().GetBlockTime()); // Genesis block's time of current network
return QDateTime::fromSecsSinceEpoch(Params().GenesisBlock().GetBlockTime()); // Genesis block's time of current network
}
double ClientModel::getVerificationProgress() const
@@ -248,7 +248,7 @@ QString ClientModel::clientName() const
QString ClientModel::formatClientStartupTime() const
{
return QDateTime::fromTime_t(nClientStartupTime).toString();
return QDateTime::fromSecsSinceEpoch(nClientStartupTime).toString();
}
void ClientModel::updateBanlist()
+6 -1
View File
@@ -730,7 +730,12 @@ void CoinControlDialog::updateView()
ui->treeWidget->setEnabled(false); // performance, otherwise updateLabels would be called for every checked checkbox
ui->treeWidget->setAlternatingRowColors(!treeMode);
QFlags<Qt::ItemFlag> flgCheckbox = Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsUserCheckable;
QFlags<Qt::ItemFlag> flgTristate = Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsUserCheckable | Qt::ItemIsTristate;
QFlags<Qt::ItemFlag> flgTristate = Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsUserCheckable |
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
Qt::ItemIsAutoTristate;
#else
Qt::ItemIsTristate;
#endif
int nDisplayUnit = model->getOptionsModel()->getDisplayUnit();
double mempoolEstimatePriority = mempool.estimatePriority(nTxConfirmTarget);
+18 -9
View File
@@ -48,14 +48,21 @@
#include <QClipboard>
#include <QDateTime>
#include <QDesktopServices>
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
#include <QDesktopWidget>
#endif
#include <QDir>
#include <QDoubleValidator>
#include <QFileDialog>
#include <QFileInfo>
#include <QFont>
#include <QGuiApplication>
#include <QLineEdit>
#include <QLocale>
#include <QRegularExpression>
#include <QScreen>
#include <QSettings>
#include <QStandardPaths>
#include <QTextDocument> // for Qt::mightBeRichText
#include <QThread>
#include <QUrlQuery>
@@ -82,12 +89,12 @@ namespace GUIUtil
{
QString dateTimeStr(const QDateTime& date)
{
return date.date().toString(Qt::SystemLocaleShortDate) + QString(" ") + date.toString("hh:mm");
return QLocale::system().toString(date.date(), QLocale::ShortFormat) + QString(" ") + date.toString("hh:mm");
}
QString dateTimeStr(qint64 nTime)
{
return dateTimeStr(QDateTime::fromTime_t((qint32)nTime));
return dateTimeStr(QDateTime::fromSecsSinceEpoch((qint32)nTime));
}
QFont bitcoinAddressFont()
@@ -269,10 +276,11 @@ QString getSaveFileName(QWidget* parent, const QString& caption, const QString&
QString result = QDir::toNativeSeparators(QFileDialog::getSaveFileName(parent, caption, myDir, filter, &selectedFilter));
/* Extract first suffix from filter pattern "Description (*.foo)" or "Description (*.foo *.bar ...) */
QRegExp filter_re(".* \\(\\*\\.(.*)[ \\)]");
QRegularExpression filter_re(".* \\(\\*\\.([^\\s\\)]+).*\\)");
QString selectedSuffix;
if (filter_re.exactMatch(selectedFilter)) {
selectedSuffix = filter_re.cap(1);
QRegularExpressionMatch filter_match = filter_re.match(selectedFilter);
if (filter_match.hasMatch()) {
selectedSuffix = filter_match.captured(1);
}
/* Add suffix if needed */
@@ -310,10 +318,11 @@ QString getOpenFileName(QWidget* parent, const QString& caption, const QString&
if (selectedSuffixOut) {
/* Extract first suffix from filter pattern "Description (*.foo)" or "Description (*.foo *.bar ...) */
QRegExp filter_re(".* \\(\\*\\.(.*)[ \\)]");
QRegularExpression filter_re(".* \\(\\*\\.([^\\s\\)]+).*\\)");
QString selectedSuffix;
if (filter_re.exactMatch(selectedFilter)) {
selectedSuffix = filter_re.cap(1);
QRegularExpressionMatch filter_match = filter_re.match(selectedFilter);
if (filter_match.hasMatch()) {
selectedSuffix = filter_match.captured(1);
}
*selectedSuffixOut = selectedSuffix;
}
@@ -809,7 +818,7 @@ bool isExternal(QString theme)
if (theme.isEmpty())
return false;
return (theme.operator!=("default"));
return theme != "default";
}
// Open CSS when configured
+1 -1
View File
@@ -120,7 +120,7 @@ OptionsDialog::OptionsDialog(QWidget* parent, bool enableWallet) : QDialog(paren
if(langStr.contains("_"))
{
/** display language strings as "native language - native country (locale name)", e.g. "Deutsch - Deutschland (de)" */
ui->lang->addItem(locale.nativeLanguageName() + QString(" - ") + locale.nativeCountryName() + QString(" (") + langStr + QString(")"), QVariant(langStr));
ui->lang->addItem(locale.nativeLanguageName() + QString(" - ") + locale.nativeTerritoryName() + QString(" (") + langStr + QString(")"), QVariant(langStr));
}
else
{
+4 -4
View File
@@ -219,12 +219,12 @@ QVariant OptionsModel::data(const QModelIndex& index, int role) const
return settings.value("fUseProxy", false);
case ProxyIP: {
// contains IP at index 0 and port at index 1
QStringList strlIpPort = settings.value("addrProxy").toString().split(":", QString::SkipEmptyParts);
QStringList strlIpPort = settings.value("addrProxy").toString().split(":", Qt::SkipEmptyParts);
return strlIpPort.at(0);
}
case ProxyPort: {
// contains IP at index 0 and port at index 1
QStringList strlIpPort = settings.value("addrProxy").toString().split(":", QString::SkipEmptyParts);
QStringList strlIpPort = settings.value("addrProxy").toString().split(":", Qt::SkipEmptyParts);
return strlIpPort.at(1);
}
@@ -308,7 +308,7 @@ bool OptionsModel::setData(const QModelIndex& index, const QVariant& value, int
break;
case ProxyIP: {
// contains current IP at index 0 and current port at index 1
QStringList strlIpPort = settings.value("addrProxy").toString().split(":", QString::SkipEmptyParts);
QStringList strlIpPort = settings.value("addrProxy").toString().split(":", Qt::SkipEmptyParts);
// if that key doesn't exist or has a changed IP
if (!settings.contains("addrProxy") || strlIpPort.at(0) != value.toString()) {
// construct new value from new IP and current port
@@ -319,7 +319,7 @@ bool OptionsModel::setData(const QModelIndex& index, const QVariant& value, int
} break;
case ProxyPort: {
// contains current IP at index 0 and current port at index 1
QStringList strlIpPort = settings.value("addrProxy").toString().split(":", QString::SkipEmptyParts);
QStringList strlIpPort = settings.value("addrProxy").toString().split(":", Qt::SkipEmptyParts);
// if that key doesn't exist or has a changed port
if (!settings.contains("addrProxy") || strlIpPort.at(1) != value.toString()) {
// construct new value from current IP and new port
+1 -1
View File
@@ -37,6 +37,7 @@
#include <QObject>
#include <QString>
#include <QSslError>
class OptionsModel;
@@ -48,7 +49,6 @@ class QByteArray;
class QLocalServer;
class QNetworkAccessManager;
class QNetworkReply;
class QSslError;
class QUrl;
QT_END_NAMESPACE
+1 -1
View File
@@ -217,7 +217,7 @@ bool RecentRequestEntryLessThan::operator()(RecentRequestEntry& left, RecentRequ
switch (column) {
case RecentRequestsTableModel::Date:
return pLeft->date.toTime_t() < pRight->date.toTime_t();
return pLeft->date.toSecsSinceEpoch() < pRight->date.toSecsSinceEpoch();
case RecentRequestsTableModel::Label:
return pLeft->recipient.label < pRight->recipient.label;
case RecentRequestsTableModel::Address:
+2 -2
View File
@@ -30,7 +30,7 @@ public:
template <typename Stream, typename Operation>
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion)
{
unsigned int nDate = date.toTime_t();
unsigned int nDate = date.toSecsSinceEpoch();
READWRITE(this->nVersion);
nVersion = this->nVersion;
@@ -39,7 +39,7 @@ public:
READWRITE(recipient);
if (ser_action.ForRead())
date = QDateTime::fromTime_t(nDate);
date = QDateTime::fromSecsSinceEpoch(nDate);
}
};
+1 -1
View File
@@ -72,7 +72,7 @@ width: 70px;
}
QToolBar > QToolButton {
Alignment: left;
qproperty-alignment: 'AlignLeft';
background-color: #372f44;
selection-background-color:transparent;
border:0.5px solid #888;
+7 -3
View File
@@ -367,7 +367,7 @@ bool RPCConsole::eventFilter(QObject* obj, QEvent* event)
case Qt::Key_PageUp: /* pass paging keys to messages widget */
case Qt::Key_PageDown:
if (obj == ui->lineEdit) {
QApplication::postEvent(ui->messagesWidget, new QKeyEvent(*keyevt));
QApplication::postEvent(ui->messagesWidget, new QKeyEvent(keyevt->type(), keyevt->key(), keyevt->modifiers(), keyevt->text(), keyevt->isAutoRepeat(), keyevt->count()));
return true;
}
break;
@@ -375,7 +375,7 @@ bool RPCConsole::eventFilter(QObject* obj, QEvent* event)
case Qt::Key_Enter:
// forward these events to lineEdit
if(obj == autoCompleter->popup()) {
QApplication::postEvent(ui->lineEdit, new QKeyEvent(*keyevt));
QApplication::postEvent(ui->lineEdit, new QKeyEvent(keyevt->type(), keyevt->key(), keyevt->modifiers(), keyevt->text(), keyevt->isAutoRepeat(), keyevt->count()));
return true;
}
break;
@@ -386,7 +386,7 @@ bool RPCConsole::eventFilter(QObject* obj, QEvent* event)
((mod & Qt::ControlModifier) && key == Qt::Key_V) ||
((mod & Qt::ShiftModifier) && key == Qt::Key_Insert))) {
ui->lineEdit->setFocus();
QApplication::postEvent(ui->lineEdit, new QKeyEvent(*keyevt));
QApplication::postEvent(ui->lineEdit, new QKeyEvent(keyevt->type(), keyevt->key(), keyevt->modifiers(), keyevt->text(), keyevt->isAutoRepeat(), keyevt->count()));
return true;
}
}
@@ -451,7 +451,11 @@ void RPCConsole::setClientModel(ClientModel* model)
connect(banAction24h, SIGNAL(triggered()), signalMapper, SLOT(map()));
connect(banAction7d, SIGNAL(triggered()), signalMapper, SLOT(map()));
connect(banAction365d, SIGNAL(triggered()), signalMapper, SLOT(map()));
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
connect(signalMapper, SIGNAL(mappedInt(int)), this, SLOT(banSelectedNode(int)));
#else
connect(signalMapper, SIGNAL(mapped(int)), this, SLOT(banSelectedNode(int)));
#endif
// peer table context menu signals
connect(ui->peerWidget, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(showPeersTableContextMenu(const QPoint&)));
+8
View File
@@ -180,11 +180,19 @@ void SendCoinsDialog::setModel(WalletModel* model)
connect(ui->sliderSmartFee, SIGNAL(valueChanged(int)), this, SLOT(updateSmartFeeLabel()));
connect(ui->sliderSmartFee, SIGNAL(valueChanged(int)), this, SLOT(updateGlobalFeeVariables()));
connect(ui->sliderSmartFee, SIGNAL(valueChanged(int)), this, SLOT(coinControlUpdateLabels()));
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
connect(ui->groupFee, SIGNAL(idClicked(int)), this, SLOT(updateFeeSectionControls()));
connect(ui->groupFee, SIGNAL(idClicked(int)), this, SLOT(updateGlobalFeeVariables()));
connect(ui->groupFee, SIGNAL(idClicked(int)), this, SLOT(coinControlUpdateLabels()));
connect(ui->groupCustomFee, SIGNAL(idClicked(int)), this, SLOT(updateGlobalFeeVariables()));
connect(ui->groupCustomFee, SIGNAL(idClicked(int)), this, SLOT(coinControlUpdateLabels()));
#else
connect(ui->groupFee, SIGNAL(buttonClicked(int)), this, SLOT(updateFeeSectionControls()));
connect(ui->groupFee, SIGNAL(buttonClicked(int)), this, SLOT(updateGlobalFeeVariables()));
connect(ui->groupFee, SIGNAL(buttonClicked(int)), this, SLOT(coinControlUpdateLabels()));
connect(ui->groupCustomFee, SIGNAL(buttonClicked(int)), this, SLOT(updateGlobalFeeVariables()));
connect(ui->groupCustomFee, SIGNAL(buttonClicked(int)), this, SLOT(coinControlUpdateLabels()));
#endif
connect(ui->customFee, SIGNAL(valueChanged()), this, SLOT(updateGlobalFeeVariables()));
connect(ui->customFee, SIGNAL(valueChanged()), this, SLOT(coinControlUpdateLabels()));
connect(ui->checkBoxMinimumFee, SIGNAL(stateChanged(int)), this, SLOT(setMinimumFee()));
+2
View File
@@ -19,7 +19,9 @@
#include <QApplication>
#include <QCloseEvent>
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
#include <QDesktopWidget>
#endif
#include <QGuiApplication>
#include <QPainter>
#include <QScreen>
+2 -2
View File
@@ -13,9 +13,9 @@
#include <QDateTime>
// Earliest date that can be represented (far in the past)
const QDateTime TransactionFilterProxy::MIN_DATE = QDateTime::fromTime_t(0);
const QDateTime TransactionFilterProxy::MIN_DATE = QDateTime::fromSecsSinceEpoch(0);
// Last date that can be represented (far in the future)
const QDateTime TransactionFilterProxy::MAX_DATE = QDateTime::fromTime_t(0xFFFFFFFF);
const QDateTime TransactionFilterProxy::MAX_DATE = QDateTime::fromSecsSinceEpoch(0xFFFFFFFF);
TransactionFilterProxy::TransactionFilterProxy(QObject* parent) : QSortFilterProxyModel(parent),
dateFrom(MIN_DATE),
+1 -1
View File
@@ -608,7 +608,7 @@ QVariant TransactionTableModel::data(const QModelIndex& index, int role) const
case TypeRole:
return rec->type;
case DateRole:
return QDateTime::fromTime_t(static_cast<uint>(rec->time));
return QDateTime::fromSecsSinceEpoch(static_cast<uint>(rec->time));
case WatchonlyRole:
return rec->involvesWatchAddress;
case WatchonlyDecorationRole:
+5 -1
View File
@@ -175,7 +175,11 @@ TransactionView::TransactionView(QWidget* parent) : QWidget(parent), model(0), t
mapperThirdPartyTxUrls = new QSignalMapper(this);
// Connect actions
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
connect(mapperThirdPartyTxUrls, SIGNAL(mappedString(QString)), this, SLOT(openThirdPartyTxUrl(QString)));
#else
connect(mapperThirdPartyTxUrls, SIGNAL(mapped(QString)), this, SLOT(openThirdPartyTxUrl(QString)));
#endif
connect(dateWidget, SIGNAL(activated(int)), this, SLOT(chooseDate(int)));
connect(typeWidget, SIGNAL(activated(int)), this, SLOT(chooseType(int)));
@@ -231,7 +235,7 @@ void TransactionView::setModel(WalletModel* model)
if (model->getOptionsModel()) {
// Add third party transaction URLs to context menu
QStringList listUrls = model->getOptionsModel()->getThirdPartyTxUrls().split("|", QString::SkipEmptyParts);
QStringList listUrls = model->getOptionsModel()->getThirdPartyTxUrls().split("|", Qt::SkipEmptyParts);
for (int i = 0; i < listUrls.size(); ++i) {
QString host = QUrl(listUrls[i].trimmed(), QUrl::StrictMode).host();
if (!host.isEmpty()) {
+2 -3
View File
@@ -22,7 +22,7 @@
#include <QCloseEvent>
#include <QLabel>
#include <QRegExp>
#include <QRegularExpression>
#include <QTextTable>
#include <QTextCursor>
#include <QVBoxLayout>
@@ -52,8 +52,7 @@ HelpMessageDialog::HelpMessageDialog(QWidget* parent, bool about) : QDialog(pare
QString licenseInfoHTML = licenseInfo;
// Make URLs clickable
QRegExp uri("<(.*)>", Qt::CaseSensitive, QRegExp::RegExp2);
uri.setMinimal(true); // use non-greedy matching
QRegularExpression uri("<(.*?)>");
licenseInfoHTML.replace(uri, "<a href=\"\\1\">\\1</a>");
// Replace newlines with HTML breaks
licenseInfoHTML.replace("\n\n", "<br><br>");
+1 -1
View File
@@ -65,7 +65,7 @@ WalletView::WalletView(QWidget* parent) : QStackedWidget(parent),
QFont fontHeaderLeft;
fontHeaderLeft.setPointSize(20);
fontHeaderLeft.setBold(true);
fontHeaderLeft.setWeight(75);
fontHeaderLeft.setWeight(QFont::Bold);
labelOverviewHeaderLeft->setFont(fontHeaderLeft);
horizontalLayout_Header->addWidget(labelOverviewHeaderLeft);
+6 -1
View File
@@ -59,7 +59,12 @@ void ZPivControlDialog::updateList()
ui->treeWidget->clear();
// add a top level item for each denomination
QFlags<Qt::ItemFlag> flgTristate = Qt::ItemIsEnabled | Qt::ItemIsUserCheckable | Qt::ItemIsTristate;
QFlags<Qt::ItemFlag> flgTristate = Qt::ItemIsEnabled | Qt::ItemIsUserCheckable |
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
Qt::ItemIsAutoTristate;
#else
Qt::ItemIsTristate;
#endif
map<libzerocoin::CoinDenomination, int> mapDenomPosition;
for (auto denom : libzerocoin::zerocoinDenomList) {
CZPivControlWidgetItem* itemDenom(new CZPivControlWidgetItem);