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/doc/snippets/javastyle.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/doc/snippets/javastyle.cpp')
| -rw-r--r-- | src/widgets/doc/snippets/javastyle.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/widgets/doc/snippets/javastyle.cpp b/src/widgets/doc/snippets/javastyle.cpp index 1d18b45c379..e1557487036 100644 --- a/src/widgets/doc/snippets/javastyle.cpp +++ b/src/widgets/doc/snippets/javastyle.cpp @@ -670,7 +670,7 @@ void JavaStyle::drawControl(ControlElement control, const QStyleOption *option, textRect); QString s = menuitem->text; if (!s.isEmpty()) { - int t = s.indexOf(QLatin1Char('\t')); + qsizetype t = s.indexOf(u'\t'); int text_flags = Qt::AlignVCenter | Qt::TextShowMnemonic | Qt::TextDontClip | Qt::TextSingleLine; if (!styleHint(SH_UnderlineShortcut, menuitem, widget)) @@ -2727,7 +2727,7 @@ QSize JavaStyle::sizeFromContents(ContentsType type, if (!menuItem->text.isEmpty()) { QFontMetrics metrics(menuItem->font); QString text = menuItem->text; - text.remove(QLatin1Char('\t')); + text.remove(u'\t'); QRect textRect = metrics.boundingRect(text); width += textRect.width(); if (height < textRect.height()) |
