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>
bb10
Friedemann Kleint 2015-11-10 11:28:38 +01:00
parent 08a4b7f745
commit 3d6975af4b
1 changed files with 40 additions and 1 deletions

View File

@ -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