From 09025084110702a17b1edd7e2e80cd9e063e64fd Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Fri, 11 Sep 2020 13:50:30 +0200 Subject: 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 --- tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'tests/auto/widgets/widgets/qmenubar') 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; -- cgit v1.2.3