diff options
Diffstat (limited to 'src/widgets/widgets/qcalendarwidget.cpp')
-rw-r--r-- | src/widgets/widgets/qcalendarwidget.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/widgets/widgets/qcalendarwidget.cpp b/src/widgets/widgets/qcalendarwidget.cpp index 510b34cb18..78706b1854 100644 --- a/src/widgets/widgets/qcalendarwidget.cpp +++ b/src/widgets/widgets/qcalendarwidget.cpp @@ -54,6 +54,7 @@ #include <qspinbox.h> #include <qmenu.h> #include <qapplication.h> +#include <private/qapplication_p.h> #include <qbasictimer.h> #include <qstylepainter.h> @@ -1384,14 +1385,14 @@ void QCalendarView::keyPressEvent(QKeyEvent *event) { #ifdef QT_KEYPAD_NAVIGATION if (event->key() == Qt::Key_Select) { - if (QApplication::keypadNavigationEnabled()) { + if (QApplicationPrivate::keypadNavigationEnabled()) { if (!hasEditFocus()) { setEditFocus(true); return; } } } else if (event->key() == Qt::Key_Back) { - if (QApplication::keypadNavigationEnabled() && hasEditFocus()) { + if (QApplicationPrivate::keypadNavigationEnabled() && hasEditFocus()) { if (qobject_cast<QCalendarModel *>(model())) { emit changeDate(origDate, true); //changes selection back to origDate, but doesn't activate setEditFocus(false); @@ -1418,7 +1419,7 @@ void QCalendarView::keyPressEvent(QKeyEvent *event) #if QT_CONFIG(wheelevent) void QCalendarView::wheelEvent(QWheelEvent *event) { - const int numDegrees = event->delta() / 8; + const int numDegrees = event->angleDelta().y() / 8; const int numSteps = numDegrees / 15; const QModelIndex index = currentIndex(); QDate currentDate = static_cast<QCalendarModel*>(model())->dateForCell(index.row(), index.column()); |