summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets/qmenu.cpp
diff options
context:
space:
mode:
authorSona Kurazyan <sona.kurazyan@qt.io>2022-04-25 14:10:21 +0200
committerSona Kurazyan <sona.kurazyan@qt.io>2022-04-26 09:01:26 +0200
commit63b042fb219a42194485e152acf6d305e4594c5c (patch)
tree1fc9ddb37dc81ea6fe1e644aa92a3ac9a823f92b /src/widgets/widgets/qmenu.cpp
parenta7dc1e280bdb63f893c720947f05ce5e24893f6f (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/qmenu.cpp')
-rw-r--r--src/widgets/widgets/qmenu.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp
index 264924a628..f0020fabcc 100644
--- a/src/widgets/widgets/qmenu.cpp
+++ b/src/widgets/widgets/qmenu.cpp
@@ -432,7 +432,7 @@ void QMenuPrivate::updateActionRects(const QRect &screen) const
sz = QSize(2, 2);
} else {
QString s = action->text();
- int t = s.indexOf(QLatin1Char('\t'));
+ qsizetype t = s.indexOf(u'\t');
if (t != -1) {
tabWidth = qMax(int(tabWidth), qfm.horizontalAdvance(s.mid(t+1)));
s = s.left(t);
@@ -1637,10 +1637,10 @@ void QMenu::initStyleOption(QStyleOptionMenuItem *option, const QAction *action)
QString textAndAccel = action->text();
#ifndef QT_NO_SHORTCUT
if ((action->isShortcutVisibleInContextMenu() || !d->isContextMenu())
- && textAndAccel.indexOf(QLatin1Char('\t')) == -1) {
+ && textAndAccel.indexOf(u'\t') == -1) {
QKeySequence seq = action->shortcut();
if (!seq.isEmpty())
- textAndAccel += QLatin1Char('\t') + seq.toString(QKeySequence::NativeText);
+ textAndAccel += u'\t' + seq.toString(QKeySequence::NativeText);
}
#endif
option->text = textAndAccel;