summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/widgets/qmenubar
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2020-09-11 13:50:30 +0200
committerLars Knoll <lars.knoll@qt.io>2020-09-28 17:23:20 +0200
commit09025084110702a17b1edd7e2e80cd9e063e64fd (patch)
tree980bed89411f5dd79bf5db5d6dea4803261ea8d1 /tests/auto/widgets/widgets/qmenubar
parent673da7d4607cd5597b3c58f8c118459efdcaaeb3 (diff)
Fix compiler warnings from QKeyCombination
Change lots of code to avoid the deprecated operator+() or implicit casts to int. Change-Id: I0c343cd5b28603afdf1214eefb85e928313345e2 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'tests/auto/widgets/widgets/qmenubar')
-rw-r--r--tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp b/tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp
index 7a9676f56b..7719a798a3 100644
--- a/tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp
+++ b/tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp
@@ -233,8 +233,8 @@ TestMenu tst_QMenuBar::initSimpleMenuBar(QMenuBar *mb, bool forceNonNative) {
QMenu *menu = mb->addMenu(QStringLiteral("&accel"));
QAction *action = menu->addAction(QStringLiteral("menu1") );
#if QT_CONFIG(shortcut)
- action->setShortcut(QKeySequence(Qt::ALT + Qt::Key_A));
- action->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_A));
+ action->setShortcut(QKeySequence(Qt::ALT | Qt::Key_A));
+ action->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_A));
#endif
connect(menu, SIGNAL(triggered(QAction*)), this, SLOT(onSimpleActivated(QAction*)));
result.menus << menu;
@@ -249,7 +249,7 @@ TestMenu tst_QMenuBar::initSimpleMenuBar(QMenuBar *mb, bool forceNonNative) {
action = menu->addAction(QStringLiteral("action"));
#if QT_CONFIG(shortcut)
- action->setShortcut(QKeySequence(Qt::ALT + Qt::Key_Z));
+ action->setShortcut(QKeySequence(Qt::ALT | Qt::Key_Z));
#endif
result.actions << action;
@@ -290,7 +290,7 @@ QAction *tst_QMenuBar::createCharacterAction(QMenu *menu, char lowerAscii)
action->setObjectName(text);
action->setData(QVariant(int(lowerAscii)));
#if QT_CONFIG(shortcut)
- action->setShortcut(Qt::CTRL + Qt::Key(lowerAscii - 'a' + int(Qt::Key_A)));
+ action->setShortcut(Qt::CTRL | Qt::Key(lowerAscii - 'a' + int(Qt::Key_A)));
#endif
connect(action, SIGNAL(triggered()), this, SLOT(onComplexActionTriggered()));
return action;
@@ -327,7 +327,7 @@ TestMenu tst_QMenuBar::initComplexMenuBar(QMenuBar *mb)
QAction *action = mb->addAction(QStringLiteral("M&enu 3"));
action->setData(QVariant(3));
#if QT_CONFIG(shortcut)
- action->setShortcut(Qt::ALT + Qt::Key_J);
+ action->setShortcut(Qt::ALT | Qt::Key_J);
#endif
connect(action, SIGNAL(triggered()), this, SLOT(onComplexActionTriggered()));
result.actions << action;