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>
This commit is contained in:
Oliver Wolff 2013-10-10 09:17:52 +02:00 committed by The Qt Project
parent df25dfef46
commit 6719307a89
2 changed files with 6 additions and 10 deletions

View File

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

View File

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