From d65c349dbf4368fb31e5a7e66f7edb4bcab1bdbb Mon Sep 17 00:00:00 2001 From: Gary Wang Date: Wed, 7 Oct 2020 16:22:55 +0800 Subject: [PATCH] fix: use QLocale for display time as locale string --- verticalpreviewwidget.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/verticalpreviewwidget.cpp b/verticalpreviewwidget.cpp index a4cf490..a31e6bb 100644 --- a/verticalpreviewwidget.cpp +++ b/verticalpreviewwidget.cpp @@ -36,9 +36,9 @@ void VerticalPreviewWidget::updatePreviewContent(const QModelIndex &index) ui->typeAndSizeLabel->setText(QString("%1 - %2").arg(mimeTypeDisplayName, this->locale().formattedDataSize(info.size()))); - ui->createdAtLabel->setText(info.birthTime().toString(tr("yyyy/MM/dd hh:mm:ss", "Qt string format"))); - ui->lastUpdateLabel->setText(info.lastModified().toString(tr("yyyy/MM/dd hh:mm:ss", "Qt string format"))); - ui->lastAccessLabel->setText(info.lastRead().toString(tr("yyyy/MM/dd hh:mm:ss", "Qt string format"))); + ui->createdAtLabel->setText(QLocale().toString(info.birthTime(), QLocale::LongFormat)); + ui->lastUpdateLabel->setText(QLocale().toString(info.lastModified(), QLocale::LongFormat)); + ui->lastAccessLabel->setText(QLocale().toString(info.lastRead(), QLocale::LongFormat)); // ui->formLayout->addRow("Created at:", new QLabel(info.birthTime().toString())); }