diff --git a/src/plugins/platforms/qnx/qqnxintegration.cpp b/src/plugins/platforms/qnx/qqnxintegration.cpp index b39311353c..dd32116360 100644 --- a/src/plugins/platforms/qnx/qqnxintegration.cpp +++ b/src/plugins/platforms/qnx/qqnxintegration.cpp @@ -162,7 +162,7 @@ QQnxIntegration::QQnxIntegration(const QStringList ¶mList) #else , m_eventDispatcher(createUnixEventDispatcher()) #endif - , m_nativeInterface(new QQnxNativeInterface()) + , m_nativeInterface(new QQnxNativeInterface(this)) , m_screenEventHandler(new QQnxScreenEventHandler(this)) #if !defined(QT_NO_CLIPBOARD) , m_clipboard(0) @@ -597,6 +597,11 @@ screen_context_t QQnxIntegration::screenContext() return ms_screenContext; } +QQnxNavigatorEventHandler *QQnxIntegration::navigatorEventHandler() +{ + return m_navigatorEventHandler; +} + screen_context_t QQnxIntegration::ms_screenContext = 0; QQnxIntegration::Options QQnxIntegration::ms_options = 0; diff --git a/src/plugins/platforms/qnx/qqnxintegration.h b/src/plugins/platforms/qnx/qqnxintegration.h index b5f03d4727..70c95ae673 100644 --- a/src/plugins/platforms/qnx/qqnxintegration.h +++ b/src/plugins/platforms/qnx/qqnxintegration.h @@ -141,6 +141,8 @@ public: static Options options(); static screen_context_t screenContext(); + QQnxNavigatorEventHandler *navigatorEventHandler(); + private: void createDisplays(); void destroyDisplays(); diff --git a/src/plugins/platforms/qnx/qqnxnativeinterface.cpp b/src/plugins/platforms/qnx/qqnxnativeinterface.cpp index df9d96739a..b89c103a06 100644 --- a/src/plugins/platforms/qnx/qqnxnativeinterface.cpp +++ b/src/plugins/platforms/qnx/qqnxnativeinterface.cpp @@ -48,12 +48,19 @@ #include "qqnxinputcontext_imf.h" #endif +#include "qqnxintegration.h" + #include #include #include QT_BEGIN_NAMESPACE +QQnxNativeInterface::QQnxNativeInterface(QQnxIntegration *integration) + : m_integration(integration) +{ +} + void *QQnxNativeInterface::nativeResourceForWindow(const QByteArray &resource, QWindow *window) { if (resource == "windowGroup" && window && window->screen()) { @@ -78,6 +85,16 @@ void *QQnxNativeInterface::nativeResourceForScreen(const QByteArray &resource, Q return 0; } +void *QQnxNativeInterface::nativeResourceForIntegration(const QByteArray &resource) +{ +#ifdef Q_OS_BLACKBERRY + if (resource == "navigatorEventHandler") + return m_integration->navigatorEventHandler(); +#endif + + return 0; +} + void *QQnxNativeInterface::nativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) { if (resource == "eglcontext" && context) diff --git a/src/plugins/platforms/qnx/qqnxnativeinterface.h b/src/plugins/platforms/qnx/qqnxnativeinterface.h index e2fdd32689..83900791f6 100644 --- a/src/plugins/platforms/qnx/qqnxnativeinterface.h +++ b/src/plugins/platforms/qnx/qqnxnativeinterface.h @@ -46,15 +46,22 @@ QT_BEGIN_NAMESPACE +class QQnxIntegration; + class QQnxNativeInterface : public QPlatformNativeInterface { public: + QQnxNativeInterface(QQnxIntegration *integration); void *nativeResourceForWindow(const QByteArray &resource, QWindow *window); void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen); + void *nativeResourceForIntegration(const QByteArray &resource); void *nativeResourceForContext(const QByteArray &resource, QOpenGLContext *context); void setWindowProperty(QPlatformWindow *window, const QString &name, const QVariant &value); NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource); + +private: + QQnxIntegration *m_integration; }; QT_END_NAMESPACE diff --git a/src/plugins/platforms/qnx/qqnxnavigatoreventhandler.cpp b/src/plugins/platforms/qnx/qqnxnavigatoreventhandler.cpp index 30dbb330d7..76d0df4920 100644 --- a/src/plugins/platforms/qnx/qqnxnavigatoreventhandler.cpp +++ b/src/plugins/platforms/qnx/qqnxnavigatoreventhandler.cpp @@ -41,6 +41,9 @@ #include "qqnxnavigatoreventhandler.h" +#include "qqnxintegration.h" +#include "qqnxscreen.h" + #include #include #include @@ -76,15 +79,8 @@ void QQnxNavigatorEventHandler::handleOrientationChange(int angle) void QQnxNavigatorEventHandler::handleSwipeDown() { qNavigatorEventHandlerDebug() << Q_FUNC_INFO; - QWindow *w = QGuiApplication::focusWindow(); - if (w) { - // Get the top level window that is ancestor of the focus window - while (QWindow *parent = w->parent()) - w = parent; - - QWindowSystemInterface::handlePlatformPanelEvent(w); - } + Q_EMIT swipeDown(); } void QQnxNavigatorEventHandler::handleExit() diff --git a/src/plugins/platforms/qnx/qqnxnavigatoreventhandler.h b/src/plugins/platforms/qnx/qqnxnavigatoreventhandler.h index cce3921a27..883d893f5e 100644 --- a/src/plugins/platforms/qnx/qqnxnavigatoreventhandler.h +++ b/src/plugins/platforms/qnx/qqnxnavigatoreventhandler.h @@ -65,6 +65,7 @@ Q_SIGNALS: void windowGroupActivated(const QByteArray &id); void windowGroupDeactivated(const QByteArray &id); void windowGroupStateChanged(const QByteArray &id, Qt::WindowState state); + void swipeDown(); }; QT_END_NAMESPACE