diff options
author | Paul Olav Tvete <paul.tvete@qt.io> | 2017-02-17 12:50:24 +0100 |
---|---|---|
committer | Paul Olav Tvete <paul.tvete@qt.io> | 2017-03-03 08:04:53 +0000 |
commit | 6cff40c1959a57b52bf0be6b427b0f807e0e82b4 (patch) | |
tree | baa503c8dd39139b32af2cb6ff9c1a370fe7944b /src/widgets/widgets | |
parent | 585bb526c4b9d810979c498e03fd2ecec54e1432 (diff) |
Build fix for -no-feature-shortcut
Change-Id: I99144b114b3c2eacb56b522b3059aa53a6bbd969
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/widgets/widgets')
-rw-r--r-- | src/widgets/widgets/qcalendarwidget.cpp | 4 | ||||
-rw-r--r-- | src/widgets/widgets/qcombobox.cpp | 2 | ||||
-rw-r--r-- | src/widgets/widgets/qdatetimeedit.cpp | 2 | ||||
-rw-r--r-- | src/widgets/widgets/qdialogbuttonbox.cpp | 4 |
4 files changed, 10 insertions, 2 deletions
diff --git a/src/widgets/widgets/qcalendarwidget.cpp b/src/widgets/widgets/qcalendarwidget.cpp index da4850a816..f81377a85c 100644 --- a/src/widgets/widgets/qcalendarwidget.cpp +++ b/src/widgets/widgets/qcalendarwidget.cpp @@ -770,8 +770,10 @@ bool QCalendarTextNavigator::eventFilter(QObject *o, QEvent *e) applyDate(); emit editingFinished(); removeDateLabel(); +#if QT_CONFIG(shortcut) } else if (ke->matches(QKeySequence::Cancel)) { removeDateLabel(); +#endif } else if (e->type() == QEvent::KeyPress) { createDateLabel(); m_dateValidator->handleKeyEvent(ke); @@ -3107,12 +3109,14 @@ void QCalendarWidget::resizeEvent(QResizeEvent * event) */ void QCalendarWidget::keyPressEvent(QKeyEvent * event) { +#if QT_CONFIG(shortcut) Q_D(QCalendarWidget); if (d->yearEdit->isVisible()&& event->matches(QKeySequence::Cancel)) { d->yearEdit->setValue(yearShown()); d->_q_yearEditingFinished(); return; } +#endif QWidget::keyPressEvent(event); } diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp index f4e08dc670..b18066c174 100644 --- a/src/widgets/widgets/qcombobox.cpp +++ b/src/widgets/widgets/qcombobox.cpp @@ -682,10 +682,12 @@ bool QComboBoxPrivateContainer::eventFilter(QObject *o, QEvent *e) combo->hidePopup(); return true; default: +#if QT_CONFIG(shortcut) if (keyEvent->matches(QKeySequence::Cancel)) { combo->hidePopup(); return true; } +#endif break; } break; diff --git a/src/widgets/widgets/qdatetimeedit.cpp b/src/widgets/widgets/qdatetimeedit.cpp index c5eab55a53..cebfb9316a 100644 --- a/src/widgets/widgets/qdatetimeedit.cpp +++ b/src/widgets/widgets/qdatetimeedit.cpp @@ -2662,11 +2662,13 @@ void QCalendarPopup::mouseReleaseEvent(QMouseEvent*) bool QCalendarPopup::event(QEvent *event) { +#if QT_CONFIG(shortcut) if (event->type() == QEvent::KeyPress) { QKeyEvent *keyEvent = static_cast<QKeyEvent*>(event); if (keyEvent->matches(QKeySequence::Cancel)) dateChanged = false; } +#endif return QWidget::event(event); } diff --git a/src/widgets/widgets/qdialogbuttonbox.cpp b/src/widgets/widgets/qdialogbuttonbox.cpp index 61ef8e8c93..5a789c2d66 100644 --- a/src/widgets/widgets/qdialogbuttonbox.cpp +++ b/src/widgets/widgets/qdialogbuttonbox.cpp @@ -410,9 +410,9 @@ QPushButton *QDialogButtonBoxPrivate::createButton(QDialogButtonBox::StandardBut qWarning("QDialogButtonBox::createButton: Invalid ButtonRole, button not added"); else addButton(button, static_cast<QDialogButtonBox::ButtonRole>(role), doLayout); - +#if QT_CONFIG(shortcut) button->setShortcut(QGuiApplicationPrivate::platformTheme()->standardButtonShortcut(sbutton)); - +#endif return button; } |