summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets/qcombobox.cpp
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2015-10-14 15:45:35 +0200
committerLiang Qi <liang.qi@theqtcompany.com>2015-10-14 15:45:35 +0200
commit4456984da780b14572e1ec0f079a4d349ab299bd (patch)
treef586a281a81c57c91c49e83a5d3ec6c7eece0578 /src/widgets/widgets/qcombobox.cpp
parente824abd987d77efaa085fe1f9fb514d270798d55 (diff)
parent281121697340084f7d385eab530f41916789b94d (diff)
Merge remote-tracking branch 'origin/5.6' into dev
Conflicts: tests/auto/corelib/io/qfile/tst_qfile.cpp tests/auto/corelib/io/qprocess/tst_qprocess.cpp tests/auto/corelib/tools/qversionnumber/qversionnumber.pro Change-Id: Ia93ce500349d96a2fbf0b4a37b73f088cc505c6e
Diffstat (limited to 'src/widgets/widgets/qcombobox.cpp')
-rw-r--r--src/widgets/widgets/qcombobox.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp
index 261a6ec2de..2a1742b652 100644
--- a/src/widgets/widgets/qcombobox.cpp
+++ b/src/widgets/widgets/qcombobox.cpp
@@ -654,8 +654,9 @@ void QComboBoxPrivateContainer::changeEvent(QEvent *e)
bool QComboBoxPrivateContainer::eventFilter(QObject *o, QEvent *e)
{
switch (e->type()) {
- case QEvent::ShortcutOverride:
- switch (static_cast<QKeyEvent*>(e)->key()) {
+ case QEvent::ShortcutOverride: {
+ QKeyEvent *keyEvent = static_cast<QKeyEvent*>(e);
+ switch (keyEvent->key()) {
case Qt::Key_Enter:
case Qt::Key_Return:
#ifdef QT_KEYPAD_NAVIGATION
@@ -667,17 +668,21 @@ bool QComboBoxPrivateContainer::eventFilter(QObject *o, QEvent *e)
}
return true;
case Qt::Key_Down:
- if (!(static_cast<QKeyEvent*>(e)->modifiers() & Qt::AltModifier))
+ if (!(keyEvent->modifiers() & Qt::AltModifier))
break;
// fall through
case Qt::Key_F4:
- case Qt::Key_Escape:
combo->hidePopup();
return true;
default:
+ if (keyEvent->matches(QKeySequence::Cancel)) {
+ combo->hidePopup();
+ return true;
+ }
break;
}
- break;
+ break;
+ }
case QEvent::MouseMove:
if (isVisible()) {
QMouseEvent *m = static_cast<QMouseEvent *>(e);