Port to QStringLiteral operator

This commit is contained in:
Jonas Kvinge
2024-10-20 06:38:55 +02:00
parent 722035913e
commit ef9ef63f02
202 changed files with 2036 additions and 1889 deletions

View File

@@ -36,6 +36,8 @@
#include "coversearchstatisticsdialog.h"
#include "ui_coversearchstatisticsdialog.h"
using namespace Qt::Literals::StringLiterals;
CoverSearchStatisticsDialog::CoverSearchStatisticsDialog(QWidget *parent)
: QDialog(parent), ui_(new Ui_CoverSearchStatisticsDialog) {
@@ -44,7 +46,7 @@ CoverSearchStatisticsDialog::CoverSearchStatisticsDialog(QWidget *parent)
details_layout_->setSpacing(0);
setStyleSheet(
QStringLiteral("#details {"
u"#details {"
" background-color: palette(base);"
"}"
"#details QLabel[type=\"label\"] {"
@@ -55,7 +57,7 @@ CoverSearchStatisticsDialog::CoverSearchStatisticsDialog(QWidget *parent)
"#details QLabel[type=\"value\"] {"
" font-weight: bold;"
" max-width: 100px;"
"}"));
"}"_s);
}
CoverSearchStatisticsDialog::~CoverSearchStatisticsDialog() { delete ui_; }
@@ -80,7 +82,7 @@ void CoverSearchStatisticsDialog::Show(const CoverSearchStatistics &statistics)
AddLine(tr("Total network requests made"), QString::number(statistics.network_requests_made_));
AddLine(tr("Average image size"), statistics.AverageDimensions());
AddLine(tr("Total bytes transferred"), statistics.bytes_transferred_ > 0 ? Utilities::PrettySize(statistics.bytes_transferred_) : QStringLiteral("0 bytes"));
AddLine(tr("Total bytes transferred"), statistics.bytes_transferred_ > 0 ? Utilities::PrettySize(statistics.bytes_transferred_) : u"0 bytes"_s);
details_layout_->addStretch();
@@ -93,8 +95,8 @@ void CoverSearchStatisticsDialog::AddLine(const QString &label, const QString &v
QLabel *label1 = new QLabel(label);
QLabel *label2 = new QLabel(value);
label1->setProperty("type", QStringLiteral("label"));
label2->setProperty("type", QStringLiteral("value"));
label1->setProperty("type", u"label"_s);
label2->setProperty("type", u"value"_s);
QHBoxLayout *layout = new QHBoxLayout;
layout->addWidget(label1);