mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-03 09:56:38 -05:00
Merge bitcoin-core/gui#137: refactor: Replace deprecated Qt::SystemLocale{Short,Long}Date
86b1ab64b1
refactor: Replace deprecated Qt::SystemLocale{Short,Long}Date (Hennadii Stepanov) Pull request description: As all deprecated warning in Qt 5.15.0 were eliminated in #46, Qt 5.15.1 introduced another one that is fixed in this PR. Required for https://github.com/bitcoin/bitcoin/pull/20182. Details in Qt docs: - https://doc.qt.io/qt-5/qdatetime.html#toString-1 - https://doc.qt.io/qt-5/qdate.html#toString-1 ACKs for top commit: jarolrod: Tested ACK86b1ab6
on MacOS 10.15.7 and Arch Linux both with Qt 5.15.1 jonasschnelli: Tested ACK86b1ab64b1
Tree-SHA512: 1dbba8ee70c895bf58317172a9901cdbe5503b1d6258f51caaae88d88d332d9fbd4697c995192d31e3618ddfd532c5f5881289b3af1184422e5a9263a1224115
This commit is contained in:
commit
f2a673f15b
2 changed files with 4 additions and 2 deletions
|
@ -11,6 +11,7 @@
|
|||
|
||||
#include <QDateTime>
|
||||
#include <QList>
|
||||
#include <QLocale>
|
||||
#include <QModelIndex>
|
||||
#include <QVariant>
|
||||
|
||||
|
@ -122,7 +123,7 @@ QVariant BanTableModel::data(const QModelIndex &index, int role) const
|
|||
case Bantime:
|
||||
QDateTime date = QDateTime::fromMSecsSinceEpoch(0);
|
||||
date = date.addSecs(rec->banEntry.nBanUntil);
|
||||
return date.toString(Qt::SystemLocaleLongDate);
|
||||
return QLocale::system().toString(date, QLocale::LongFormat);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -43,6 +43,7 @@
|
|||
#include <QKeyEvent>
|
||||
#include <QLineEdit>
|
||||
#include <QList>
|
||||
#include <QLocale>
|
||||
#include <QMenu>
|
||||
#include <QMouseEvent>
|
||||
#include <QProgressDialog>
|
||||
|
@ -67,7 +68,7 @@ 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)
|
||||
|
|
Loading…
Add table
Reference in a new issue