diff options
author | Sona Kurazyan <sona.kurazyan@qt.io> | 2019-07-22 11:12:38 +0200 |
---|---|---|
committer | Sona Kurazyan <sona.kurazyan@qt.io> | 2019-07-23 20:48:33 +0200 |
commit | 9c2f18d35764fe4c5452d3aa500bd2824ebe7564 (patch) | |
tree | e12b70c175f90dedc081c7907260847425122d48 /src/widgets/util | |
parent | 19f72c17c03b5065b98e0a7f3aae08ef7ca1ef03 (diff) |
Remove usages of deprecated QApplication::keypadNavigationEnabled
Added QApplicationPrivate::keypadNavigationEnabled() as a
replacement of deprecated QApplication::keypadNavigationEnabled(),
for the internal usage.
Task-number: QTBUG-76491
Change-Id: I75f4c628b72d86b5e428e7e285a786d23abbf3f2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/widgets/util')
-rw-r--r-- | src/widgets/util/qcompleter.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/widgets/util/qcompleter.cpp b/src/widgets/util/qcompleter.cpp index ee0418b5b8..7b69eff30c 100644 --- a/src/widgets/util/qcompleter.cpp +++ b/src/widgets/util/qcompleter.cpp @@ -161,6 +161,7 @@ #include "QtWidgets/qapplication.h" #include "QtGui/qevent.h" #include "QtWidgets/qdesktopwidget.h" +#include <private/qapplication_p.h> #include <private/qdesktopwidget_p.h> #if QT_CONFIG(lineedit) #include "QtWidgets/qlineedit.h" @@ -1416,7 +1417,7 @@ bool QCompleter::eventFilter(QObject *o, QEvent *e) // widget lost focus, hide the popup if (d->widget && (!d->widget->hasFocus() #ifdef QT_KEYPAD_NAVIGATION - || (QApplication::keypadNavigationEnabled() && !d->widget->hasEditFocus()) + || (QApplicationPrivate::keypadNavigationEnabled() && !d->widget->hasEditFocus()) #endif )) d->popup->hide(); @@ -1434,7 +1435,7 @@ bool QCompleter::eventFilter(QObject *o, QEvent *e) switch (key) { #ifdef QT_KEYPAD_NAVIGATION case Qt::Key_Select: - if (!QApplication::keypadNavigationEnabled()) + if (!QApplicationPrivate::keypadNavigationEnabled()) break; #endif case Qt::Key_Return: @@ -1464,7 +1465,7 @@ bool QCompleter::eventFilter(QObject *o, QEvent *e) #ifdef QT_KEYPAD_NAVIGATION case QEvent::KeyRelease: { QKeyEvent *ke = static_cast<QKeyEvent *>(e); - if (QApplication::keypadNavigationEnabled() && ke->key() == Qt::Key_Back) { + if (QApplicationPrivate::keypadNavigationEnabled() && ke->key() == Qt::Key_Back) { // Send the event to the 'widget'. This is what we did for KeyPress, so we need // to do the same for KeyRelease, in case the widget's KeyPress event set // up something (such as a timer) that is relying on also receiving the @@ -1481,7 +1482,7 @@ bool QCompleter::eventFilter(QObject *o, QEvent *e) case QEvent::MouseButtonPress: { #ifdef QT_KEYPAD_NAVIGATION - if (QApplication::keypadNavigationEnabled()) { + if (QApplicationPrivate::keypadNavigationEnabled()) { // if we've clicked in the widget (or its descendant), let it handle the click QWidget *source = qobject_cast<QWidget *>(o); if (source) { |