summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorFabian Bumberger <fbumberger@rim.com>2014-02-08 18:32:12 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-02-16 20:21:43 +0100
commit0827f0bd6659db97fe8d8d062a1812f9f434fb50 (patch)
tree04962719eeac1afdaf26efa10a747cdd49800a95 /src/plugins
parentddbbf2b4a71b15181a33d911b99f2e0650566edf (diff)
Refactor the handling of the navigator swipe down event
The navigator swipe down event is not mapped to a platform panel event any more. Instead the NavigatorEventHandler is exposed through the QPlatformNativeInterface. Change-Id: I6d29bba011849da5210f6f4d595e3c2e0c021449 Reviewed-by: Bernd Weimer <bweimer@blackberry.com> Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/platforms/qnx/qqnxintegration.cpp7
-rw-r--r--src/plugins/platforms/qnx/qqnxintegration.h2
-rw-r--r--src/plugins/platforms/qnx/qqnxnativeinterface.cpp17
-rw-r--r--src/plugins/platforms/qnx/qqnxnativeinterface.h7
-rw-r--r--src/plugins/platforms/qnx/qqnxnavigatoreventhandler.cpp12
-rw-r--r--src/plugins/platforms/qnx/qqnxnavigatoreventhandler.h1
6 files changed, 37 insertions, 9 deletions
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 &paramList)
#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 <QtGui/QOpenGLContext>
#include <QtGui/QScreen>
#include <QtGui/QWindow>
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 <QDebug>
#include <QGuiApplication>
#include <qpa/qwindowsysteminterface.h>
@@ -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