summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/widgets')
-rw-r--r--src/widgets/widgets/qabstractbutton.cpp2
-rw-r--r--src/widgets/widgets/qeffects.cpp5
-rw-r--r--src/widgets/widgets/qmenu.cpp13
-rw-r--r--src/widgets/widgets/qmenubar.cpp6
4 files changed, 21 insertions, 5 deletions
diff --git a/src/widgets/widgets/qabstractbutton.cpp b/src/widgets/widgets/qabstractbutton.cpp
index d04ee24861..c0bd8bce5a 100644
--- a/src/widgets/widgets/qabstractbutton.cpp
+++ b/src/widgets/widgets/qabstractbutton.cpp
@@ -1100,6 +1100,7 @@ void QAbstractButton::keyPressEvent(QKeyEvent *e)
break;
}
default:
+#ifndef QT_NO_SHORTCUT
if (e->matches(QKeySequence::Cancel) && d->down) {
setDown(false);
repaint(); //flush paint event before invoking potentially expensive operation
@@ -1107,6 +1108,7 @@ void QAbstractButton::keyPressEvent(QKeyEvent *e)
d->emitReleased();
return;
}
+#endif
e->ignore();
}
}
diff --git a/src/widgets/widgets/qeffects.cpp b/src/widgets/widgets/qeffects.cpp
index b02651767c..ecd85c2ca7 100644
--- a/src/widgets/widgets/qeffects.cpp
+++ b/src/widgets/widgets/qeffects.cpp
@@ -202,10 +202,13 @@ bool QAlphaWidget::eventFilter(QObject *o, QEvent *e)
render();
break;
case QEvent::KeyPress: {
+#ifndef QT_NO_SHORTCUT
QKeyEvent *ke = (QKeyEvent*)e;
if (ke->matches(QKeySequence::Cancel)) {
showWidget = false;
- } else {
+ } else
+#endif
+ {
duration = 0;
}
render();
diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp
index 5cea9a9ea2..f4cf2597e0 100644
--- a/src/widgets/widgets/qmenu.cpp
+++ b/src/widgets/widgets/qmenu.cpp
@@ -2731,7 +2731,10 @@ QMenu::event(QEvent *e)
if (kev->key() == Qt::Key_Up || kev->key() == Qt::Key_Down
|| kev->key() == Qt::Key_Left || kev->key() == Qt::Key_Right
|| kev->key() == Qt::Key_Enter || kev->key() == Qt::Key_Return
- || kev->matches(QKeySequence::Cancel)) {
+#ifndef QT_NO_SHORTCUT
+ || kev->matches(QKeySequence::Cancel)
+#endif
+ ) {
e->accept();
return true;
}
@@ -3059,7 +3062,11 @@ void QMenu::keyPressEvent(QKeyEvent *e)
key_consumed = false;
}
- if (!key_consumed && (e->matches(QKeySequence::Cancel)
+ if (!key_consumed && (
+ false
+#ifndef QT_NO_SHORTCUT
+ || e->matches(QKeySequence::Cancel)
+#endif
#ifdef QT_KEYPAD_NAVIGATION
|| e->key() == Qt::Key_Back
#endif
@@ -3275,7 +3282,9 @@ static void copyActionToPlatformItem(const QAction *action, QPlatformMenuItem *i
item->setIcon(QIcon());
}
item->setVisible(action->isVisible());
+#ifndef QT_NO_SHORTCUT
item->setShortcut(action->shortcut());
+#endif
item->setCheckable(action->isCheckable());
item->setChecked(action->isChecked());
item->setHasExclusiveGroup(action->actionGroup() && action->actionGroup()->isExclusive());
diff --git a/src/widgets/widgets/qmenubar.cpp b/src/widgets/widgets/qmenubar.cpp
index 45b7b3091a..68262bb8e4 100644
--- a/src/widgets/widgets/qmenubar.cpp
+++ b/src/widgets/widgets/qmenubar.cpp
@@ -1113,11 +1113,13 @@ void QMenuBar::keyPressEvent(QKeyEvent *e)
key_consumed = false;
}
+#ifndef QT_NO_SHORTCUT
if (!key_consumed && e->matches(QKeySequence::Cancel)) {
d->setCurrentAction(0);
d->setKeyboardMode(false);
key_consumed = true;
}
+#endif
if(!key_consumed &&
(!e->modifiers() ||
@@ -1425,6 +1427,7 @@ bool QMenuBar::event(QEvent *e)
case QEvent::Show:
d->_q_updateLayout();
break;
+#ifndef QT_NO_SHORTCUT
case QEvent::ShortcutOverride: {
QKeyEvent *kev = static_cast<QKeyEvent*>(e);
//we only filter out escape if there is a current action
@@ -1434,8 +1437,7 @@ bool QMenuBar::event(QEvent *e)
}
}
break;
-
-
+#endif
#ifndef QT_NO_WHATSTHIS
case QEvent::QueryWhatsThis:
e->setAccepted(d->whatsThis.size());