summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-11-10 11:28:38 +0100
committerFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-11-14 18:22:29 +0000
commit3d6975af4b0b77f13b5a4f36f82b86ed551aa85a (patch)
tree4292660d4f3cddb39a4f6cc047462a1e69dfabb5 /src/plugins/platforms
parent08a4b7f74507be7aa9dc09a9234d3bc83d4ed908 (diff)
Compile minimalegl QPA plugin on Windows/WinRT.
Add event dispatchers. Change-Id: I548b50d1ec648fa8cb6c77881c95125f361343f0 Reviewed-by: Andrew Knight <andrew.knight@intopalo.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r--src/plugins/platforms/minimalegl/qminimaleglintegration.cpp41
1 files changed, 40 insertions, 1 deletions
diff --git a/src/plugins/platforms/minimalegl/qminimaleglintegration.cpp b/src/plugins/platforms/minimalegl/qminimaleglintegration.cpp
index ef96985f1a..1bcb22618e 100644
--- a/src/plugins/platforms/minimalegl/qminimaleglintegration.cpp
+++ b/src/plugins/platforms/minimalegl/qminimaleglintegration.cpp
@@ -37,7 +37,15 @@
#include "qminimaleglbackingstore.h"
#include <QtPlatformSupport/private/qgenericunixfontdatabase_p.h>
-#include <QtPlatformSupport/private/qgenericunixeventdispatcher_p.h>
+
+#if defined(Q_OS_UNIX)
+# include <QtPlatformSupport/private/qgenericunixeventdispatcher_p.h>
+#elif defined(Q_OS_WINRT)
+# include <QtCore/private/qeventdispatcher_winrt_p.h>
+# include <QtGui/qpa/qwindowsysteminterface.h>
+#elif defined(Q_OS_WIN)
+# include <QtPlatformSupport/private/qwindowsguieventdispatcher_p.h>
+#endif
#include <qpa/qplatformwindow.h>
#include <QtGui/QSurfaceFormat>
@@ -48,6 +56,29 @@
QT_BEGIN_NAMESPACE
+#ifdef Q_OS_WINRT
+namespace {
+class QWinRTEventDispatcher : public QEventDispatcherWinRT {
+public:
+ QWinRTEventDispatcher() {}
+
+protected:
+ bool hasPendingEvents() Q_DECL_OVERRIDE
+ {
+ return QEventDispatcherWinRT::hasPendingEvents() || QWindowSystemInterface::windowSystemEventsQueued();
+ }
+
+ bool sendPostedEvents(QEventLoop::ProcessEventsFlags flags)
+ {
+ bool didProcess = QEventDispatcherWinRT::sendPostedEvents(flags);
+ if (!(flags & QEventLoop::ExcludeUserInputEvents))
+ didProcess |= QWindowSystemInterface::sendWindowSystemEvents(flags);
+ return didProcess;
+ }
+};
+} // anonymous namespace
+#endif // Q_OS_WINRT
+
QMinimalEglIntegration::QMinimalEglIntegration()
: mFontDb(new QGenericUnixFontDatabase()), mScreen(new QMinimalEglScreen(EGL_DEFAULT_DISPLAY))
{
@@ -104,7 +135,15 @@ QPlatformFontDatabase *QMinimalEglIntegration::fontDatabase() const
QAbstractEventDispatcher *QMinimalEglIntegration::createEventDispatcher() const
{
+#if defined(Q_OS_UNIX)
return createUnixEventDispatcher();
+#elif defined(Q_OS_WINRT)
+ return new QWinRTEventDispatcher;
+#elif defined(Q_OS_WIN)
+ return new QWindowsGuiEventDispatcher;
+#else
+ return Q_NULLPTR;
+#endif
}
QVariant QMinimalEglIntegration::styleHint(QPlatformIntegration::StyleHint hint) const