summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets/qspinbox.cpp
diff options
context:
space:
mode:
authorSona Kurazyan <sona.kurazyan@qt.io>2022-04-25 16:16:10 +0200
committerSona Kurazyan <sona.kurazyan@qt.io>2022-05-02 09:07:19 +0200
commit7d79b94db7debdd1896d1912e3052d5950b05df5 (patch)
treeec0104f8a8a14cec4ca7074d3aeb0ada78ea96e4 /src/widgets/widgets/qspinbox.cpp
parent43b779ab0462f85f9c2cce86ec2701f56306ac87 (diff)
QtWidgets: use _L1 for for creating Latin-1 string literals
Task-number: QTBUG-98434 Change-Id: I310ea8f19d73a79d985ebfb8bfbff7a02c424360 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/widgets/widgets/qspinbox.cpp')
-rw-r--r--src/widgets/widgets/qspinbox.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/widgets/widgets/qspinbox.cpp b/src/widgets/widgets/qspinbox.cpp
index a5ce8f658a..b6308eda76 100644
--- a/src/widgets/widgets/qspinbox.cpp
+++ b/src/widgets/widgets/qspinbox.cpp
@@ -51,6 +51,8 @@
QT_BEGIN_NAMESPACE
+using namespace Qt::StringLiterals;
+
//#define QSPINBOX_QSBDEBUG
#ifdef QSPINBOX_QSBDEBUG
# define QSBDEBUG qDebug
@@ -518,7 +520,7 @@ QString QSpinBox::textFromValue(int value) const
QString str;
if (d->displayIntegerBase != 10) {
- const QLatin1String prefix = value < 0 ? QLatin1String("-") : QLatin1String();
+ const auto prefix = value < 0 ? "-"_L1 : ""_L1;
str = prefix + QString::number(qAbs(value), d->displayIntegerBase);
} else {
str = locale().toString(value);
@@ -1126,8 +1128,8 @@ QVariant QSpinBoxPrivate::validateAndInterpret(QString &input, int &pos,
int num = min;
if (max != min && (copy.isEmpty()
- || (min < 0 && copy == QLatin1String("-"))
- || (max >= 0 && copy == QLatin1String("+")))) {
+ || (min < 0 && copy == "-"_L1)
+ || (max >= 0 && copy == "+"_L1))) {
state = QValidator::Intermediate;
QSBDEBUG() << __FILE__ << __LINE__<< "num is set to" << num;
} else if (copy.startsWith(u'-') && min >= 0) {