diff options
Diffstat (limited to 'src/widgets/widgets/qcalendarwidget.cpp')
-rw-r--r-- | src/widgets/widgets/qcalendarwidget.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/widgets/widgets/qcalendarwidget.cpp b/src/widgets/widgets/qcalendarwidget.cpp index b0ded70c4a..f81377a85c 100644 --- a/src/widgets/widgets/qcalendarwidget.cpp +++ b/src/widgets/widgets/qcalendarwidget.cpp @@ -765,13 +765,15 @@ bool QCalendarTextNavigator::eventFilter(QObject *o, QEvent *e) if (m_widget) { if (e->type() == QEvent::KeyPress || e->type() == QEvent::KeyRelease) { QKeyEvent* ke = (QKeyEvent*)e; - if ((ke->text().length() > 0 && ke->text()[0].isPrint()) || m_dateFrame) { + if ((ke->text().length() > 0 && ke->text().at(0).isPrint()) || m_dateFrame) { if (ke->key() == Qt::Key_Return || ke->key() == Qt::Key_Enter || ke->key() == Qt::Key_Select) { 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); } |