diff options
author | Oliver Wolff <oliver.wolff@digia.com> | 2013-10-10 09:17:52 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-10-12 01:11:22 +0200 |
commit | 6719307a891e3e935e5a589aaceeefb884772378 (patch) | |
tree | 60e9b9b4600ef8a506c4e5ec8cf3d1cc7a61e152 /src/plugins | |
parent | df25dfef46b1174e6f545e681be3f0ef1541fd75 (diff) |
WinRT: Adopt new event dispatcher approach for WinRT plugin
Change-Id: I5605cbe926b57b981071d71187aca6af5d2e6269
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/platforms/winrt/qwinrtintegration.cpp | 13 | ||||
-rw-r--r-- | src/plugins/platforms/winrt/qwinrtintegration.h | 3 |
2 files changed, 6 insertions, 10 deletions
diff --git a/src/plugins/platforms/winrt/qwinrtintegration.cpp b/src/plugins/platforms/winrt/qwinrtintegration.cpp index 9113ffeb19..4cc7eb31f1 100644 --- a/src/plugins/platforms/winrt/qwinrtintegration.cpp +++ b/src/plugins/platforms/winrt/qwinrtintegration.cpp @@ -103,12 +103,6 @@ QWinRTIntegration::QWinRTIntegration() m_screen = new QWinRTScreen(window); screenAdded(m_screen); - // Get event dispatcher - ICoreDispatcher *dispatcher; - if (FAILED(window->get_Dispatcher(&dispatcher))) - qCritical("Could not capture UI Dispatcher"); - m_eventDispatcher = new QWinRTEventDispatcher(dispatcher); - m_success = true; } @@ -117,9 +111,12 @@ QWinRTIntegration::~QWinRTIntegration() Windows::Foundation::Uninitialize(); } -QAbstractEventDispatcher *QWinRTIntegration::guiThreadEventDispatcher() const +QAbstractEventDispatcher *QWinRTIntegration::createEventDispatcher() const { - return m_eventDispatcher; + ICoreDispatcher *dispatcher; + if (FAILED(m_screen->coreWindow()->get_Dispatcher(&dispatcher))) + qCritical("Could not capture UI Dispatcher"); + return new QWinRTEventDispatcher(dispatcher); } bool QWinRTIntegration::hasCapability(QPlatformIntegration::Capability cap) const diff --git a/src/plugins/platforms/winrt/qwinrtintegration.h b/src/plugins/platforms/winrt/qwinrtintegration.h index b53c1cf7d2..6cf2c3e5f2 100644 --- a/src/plugins/platforms/winrt/qwinrtintegration.h +++ b/src/plugins/platforms/winrt/qwinrtintegration.h @@ -68,7 +68,7 @@ public: QPlatformWindow *createPlatformWindow(QWindow *window) const; QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const; QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const; - QAbstractEventDispatcher *guiThreadEventDispatcher() const; + QAbstractEventDispatcher *createEventDispatcher() const; QPlatformFontDatabase *fontDatabase() const; QPlatformInputContext *inputContext() const; QPlatformServices *services() const; @@ -76,7 +76,6 @@ public: private: bool m_success; QWinRTScreen *m_screen; - QAbstractEventDispatcher *m_eventDispatcher; QPlatformFontDatabase *m_fontDatabase; QPlatformServices *m_services; }; |