Fix compilation of Minimalplugin, add documentation.

Change-Id: I3b40eed781905610cc3062d25dcccf5f760de1f0
Reviewed-on: http://codereview.qt.nokia.com/2382
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
This commit is contained in:
Friedemann Kleint 2011-07-29 09:47:19 +02:00 committed by Jørgen Lind
parent dfd72c6e6c
commit db9b79f715
3 changed files with 24 additions and 12 deletions

View File

@ -171,11 +171,15 @@ QPlatformNativeInterface * QPlatformIntegration::nativeInterface() const
*/ */
/*! /*!
\fn QAbstractEventDispatcher *createEventDispatcher() const
Factory function for the event dispatcher. The platform plugin \fn QAbstractEventDispatcher *guiThreadEventDispatcher() const = 0
must create and and return a QAbstractEventDispatcher subclass when
this function is called. Accessor function for the event dispatcher. The platform plugin should create
an instance of the QAbstractEventDispatcher in its constructor and set it
on the application using QGuiApplicationPrivate::instance()->setEventDispatcher().
The event dispatcher is owned by QGuiApplication, the accessor should return
a flat pointer.
\sa QGuiApplicationPrivate
*/ */
bool QPlatformIntegration::hasCapability(Capability cap) const bool QPlatformIntegration::hasCapability(Capability cap) const

View File

@ -48,10 +48,19 @@
#endif #endif
#include <QtGui/private/qpixmap_raster_p.h> #include <QtGui/private/qpixmap_raster_p.h>
#include <QtGui/private/qguiapplication_p.h>
#include <QtGui/QPlatformWindow> #include <QtGui/QPlatformWindow>
QMinimalIntegration::QMinimalIntegration() QT_BEGIN_NAMESPACE
QMinimalIntegration::QMinimalIntegration() :
#ifdef Q_OS_WIN
m_eventDispatcher(new QEventDispatcherWin32())
#else
m_eventDispatcher(createUnixEventDispatcher())
#endif
{ {
QGuiApplicationPrivate::instance()->setEventDispatcher(m_eventDispatcher);
QMinimalScreen *mPrimaryScreen = new QMinimalScreen(); QMinimalScreen *mPrimaryScreen = new QMinimalScreen();
mPrimaryScreen->mGeometry = QRect(0, 0, 240, 320); mPrimaryScreen->mGeometry = QRect(0, 0, 240, 320);
@ -80,12 +89,9 @@ QPlatformBackingStore *QMinimalIntegration::createPlatformBackingStore(QWindow *
return new QMinimalBackingStore(window); return new QMinimalBackingStore(window);
} }
QAbstractEventDispatcher *QMinimalIntegration::createEventDispatcher() const QAbstractEventDispatcher *QMinimalIntegration::guiThreadEventDispatcher() const
{ {
#ifndef Q_OS_WIN return m_eventDispatcher;
return createUnixEventDispatcher();
#else
return new QEventDispatcherWin32();
#endif
} }
QT_END_NAMESPACE

View File

@ -73,8 +73,10 @@ public:
QPlatformWindow *createPlatformWindow(QWindow *window) const; QPlatformWindow *createPlatformWindow(QWindow *window) const;
QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const; QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const;
QAbstractEventDispatcher *guiThreadEventDispatcher() const;
QAbstractEventDispatcher *createEventDispatcher() const; private:
QAbstractEventDispatcher *m_eventDispatcher;
}; };
QT_END_NAMESPACE QT_END_NAMESPACE