diff options
author | Sona Kurazyan <sona.kurazyan@qt.io> | 2022-04-25 14:10:21 +0200 |
---|---|---|
committer | Sona Kurazyan <sona.kurazyan@qt.io> | 2022-04-26 09:01:26 +0200 |
commit | 63b042fb219a42194485e152acf6d305e4594c5c (patch) | |
tree | 1fc9ddb37dc81ea6fe1e644aa92a3ac9a823f92b /src/widgets/widgets/qspinbox.cpp | |
parent | a7dc1e280bdb63f893c720947f05ce5e24893f6f (diff) |
QtWidgets: stop using QLatin1Char constructor for creating char literals
Required for porting away from QLatin1Char/QLatin1String in scope of
QTBUG-98434.
As a drive-by, fix qsizetype -> int narrowing conversion warnings for
the touched lines.
Change-Id: I133b80334b66e0a5ab9546dd8e1ff0631e79601e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/widgets/widgets/qspinbox.cpp')
-rw-r--r-- | src/widgets/widgets/qspinbox.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/widgets/widgets/qspinbox.cpp b/src/widgets/widgets/qspinbox.cpp index e504d7f535..a5ce8f658a 100644 --- a/src/widgets/widgets/qspinbox.cpp +++ b/src/widgets/widgets/qspinbox.cpp @@ -977,9 +977,8 @@ void QDoubleSpinBox::setDecimals(int decimals) This virtual function is used by the spin box whenever it needs to display the given \a value. The default implementation returns a string containing \a value printed using QWidget::locale().toString(\a value, - QLatin1Char('f'), decimals()) and will remove the thousand - separator unless setGroupSeparatorShown() is set. Reimplementations may - return anything. + \c u'f', decimals()) and will remove the thousand separator unless + setGroupSeparatorShown() is set. Reimplementations may return anything. Note: QDoubleSpinBox does not call this function for specialValueText() and that neither prefix() nor suffix() should @@ -1131,7 +1130,7 @@ QVariant QSpinBoxPrivate::validateAndInterpret(QString &input, int &pos, || (max >= 0 && copy == QLatin1String("+")))) { state = QValidator::Intermediate; QSBDEBUG() << __FILE__ << __LINE__<< "num is set to" << num; - } else if (copy.startsWith(QLatin1Char('-')) && min >= 0) { + } else if (copy.startsWith(u'-') && min >= 0) { state = QValidator::Invalid; // special-case -0 will be interpreted as 0 and thus not be invalid with a range from 0-100 } else { bool ok = false; @@ -1291,15 +1290,15 @@ QVariant QDoubleSpinBoxPrivate::validateAndInterpret(QString &input, int &pos, goto end; case 1: if (copy.at(0) == locale.decimalPoint() - || (plus && copy.at(0) == QLatin1Char('+')) - || (minus && copy.at(0) == QLatin1Char('-'))) { + || (plus && copy.at(0) == u'+') + || (minus && copy.at(0) == u'-')) { state = QValidator::Intermediate; goto end; } break; case 2: if (copy.at(1) == locale.decimalPoint() - && ((plus && copy.at(0) == QLatin1Char('+')) || (minus && copy.at(0) == QLatin1Char('-')))) { + && ((plus && copy.at(0) == u'+') || (minus && copy.at(0) == u'-'))) { state = QValidator::Intermediate; goto end; } |