summaryrefslogtreecommitdiffstats
path: root/src/qdbus/qdbusviewer/propertydialog.cpp
diff options
context:
space:
mode:
authorIevgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>2023-05-12 15:29:49 +0200
committerIevgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>2023-05-16 12:57:55 +0200
commita881b57cc8dbbfc090deb940973d6a1239ce77ed (patch)
treed5643d6e5ef4d335722b253b6e3062ff98a4ab55 /src/qdbus/qdbusviewer/propertydialog.cpp
parent450bb8dacdff2c0dd24bbe9eea998c70bd5f6fae (diff)
qdbusviewer: Use modern string literals
Replace most uses of QLatin1String by _L1, QStringLiteral by _s. Use tr() for user-visible strings. Reorganize the loop inside QDBusViewer::dumpMessage() slightly to make it less sensitive to translation changes. Change-Id: Id987bd0efe06d0efd80c57982c3c2a6a031c369a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/qdbus/qdbusviewer/propertydialog.cpp')
-rw-r--r--src/qdbus/qdbusviewer/propertydialog.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/qdbus/qdbusviewer/propertydialog.cpp b/src/qdbus/qdbusviewer/propertydialog.cpp
index 6d133d7af..5fbfd94bc 100644
--- a/src/qdbus/qdbusviewer/propertydialog.cpp
+++ b/src/qdbus/qdbusviewer/propertydialog.cpp
@@ -7,6 +7,8 @@
#include <QLayout>
#include <QDebug>
+using namespace Qt::StringLiterals;
+
PropertyDialog::PropertyDialog(QWidget *parent, Qt::WindowFlags f)
: QDialog(parent, f)
{
@@ -16,7 +18,7 @@ PropertyDialog::PropertyDialog(QWidget *parent, Qt::WindowFlags f)
buttonBox->setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
propertyTable->setColumnCount(2);
- const QStringList labels = QStringList() << QLatin1String("Name") << QLatin1String("Value");
+ const QStringList labels = QStringList() << tr("Name") << tr("Value");
propertyTable->setHorizontalHeaderLabels(labels);
propertyTable->horizontalHeader()->setStretchLastSection(true);
propertyTable->setEditTriggers(QAbstractItemView::AllEditTriggers);
@@ -42,10 +44,10 @@ void PropertyDialog::addProperty(const QString &aname, int type)
QString name = aname;
if (name.isEmpty())
- name = QLatin1String("argument ") + QString::number(rowCount + 1);
- name += QLatin1String(" (");
+ name = tr("argument %1").arg(rowCount + 1);
+ name += " ("_L1;
name += QLatin1String(QMetaType(type).name());
- name += QLatin1String(")");
+ name += ")"_L1;
QTableWidgetItem *nameItem = new QTableWidgetItem(name);
nameItem->setFlags(nameItem->flags() &
~(Qt::ItemIsEditable | Qt::ItemIsSelectable));