mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-26 11:13:23 -03:00
refactor: Replace deprecated Qt::SystemLocale{Short,Long}Date
This commit is contained in:
parent
50091592dd
commit
86b1ab64b1
2 changed files with 4 additions and 2 deletions
|
@ -11,6 +11,7 @@
|
||||||
|
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
#include <QList>
|
#include <QList>
|
||||||
|
#include <QLocale>
|
||||||
#include <QModelIndex>
|
#include <QModelIndex>
|
||||||
#include <QVariant>
|
#include <QVariant>
|
||||||
|
|
||||||
|
@ -122,7 +123,7 @@ QVariant BanTableModel::data(const QModelIndex &index, int role) const
|
||||||
case Bantime:
|
case Bantime:
|
||||||
QDateTime date = QDateTime::fromMSecsSinceEpoch(0);
|
QDateTime date = QDateTime::fromMSecsSinceEpoch(0);
|
||||||
date = date.addSecs(rec->banEntry.nBanUntil);
|
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 <QKeyEvent>
|
||||||
#include <QLineEdit>
|
#include <QLineEdit>
|
||||||
#include <QList>
|
#include <QList>
|
||||||
|
#include <QLocale>
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
#include <QMouseEvent>
|
#include <QMouseEvent>
|
||||||
#include <QProgressDialog>
|
#include <QProgressDialog>
|
||||||
|
@ -67,7 +68,7 @@ namespace GUIUtil {
|
||||||
|
|
||||||
QString dateTimeStr(const QDateTime &date)
|
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)
|
QString dateTimeStr(qint64 nTime)
|
||||||
|
|
Loading…
Add table
Reference in a new issue