Compile fix for QtGui when configure with -qpa on Windows

Reviewed-by: Friedemann Kleint
This commit is contained in:
Olli Werwolff 2011-05-25 10:11:58 +02:00
parent 07818c429c
commit ed529bbf49
11 changed files with 44 additions and 24 deletions

View File

@ -48,12 +48,12 @@ SOURCES += \
image/qimagepixmapcleanuphooks.cpp \ image/qimagepixmapcleanuphooks.cpp \
image/qvolatileimage.cpp image/qvolatileimage.cpp
win32 { qpa: {
SOURCES += image/qpixmap_win.cpp
}
else:qpa {
SOURCES += image/qpixmap_qpa.cpp SOURCES += image/qpixmap_qpa.cpp
} }
else:win32 {
SOURCES += image/qpixmap_win.cpp
}
else:x11 { else:x11 {
HEADERS += image/qpixmap_x11_p.h HEADERS += image/qpixmap_x11_p.h
SOURCES += image/qpixmap_x11.cpp SOURCES += image/qpixmap_x11.cpp

View File

@ -42,7 +42,6 @@
#include "qplatformdefs.h" #include "qplatformdefs.h"
#include "qcoreapplication.h" #include "qcoreapplication.h"
#include "qeventdispatcher_qpa_p.h" #include "qeventdispatcher_qpa_p.h"
#include "private/qeventdispatcher_unix_p.h"
#include "private/qguiapplication_p.h" #include "private/qguiapplication_p.h"
#include "qplatformeventloopintegration_qpa.h" #include "qplatformeventloopintegration_qpa.h"
@ -112,7 +111,7 @@ private:
fd_set *m_readfds, *m_writefds, *m_exceptfds; fd_set *m_readfds, *m_writefds, *m_exceptfds;
}; };
class QEventDispatcherQPAPrivate : public QEventDispatcherUNIXPrivate class QEventDispatcherQPAPrivate : public EVENTDISPATCHERBASEPRIVATE
{ {
Q_DECLARE_PUBLIC(QEventDispatcherQPA) Q_DECLARE_PUBLIC(QEventDispatcherQPA)
public: public:
@ -192,7 +191,7 @@ private:
}; };
QEventDispatcherQPA::QEventDispatcherQPA(QObject *parent) QEventDispatcherQPA::QEventDispatcherQPA(QObject *parent)
: QEventDispatcherUNIX(*new QEventDispatcherQPAPrivate, parent) : EVENTDISPATCHERBASE(*new QEventDispatcherQPAPrivate, parent)
{ } { }
QEventDispatcherQPA::~QEventDispatcherQPA() QEventDispatcherQPA::~QEventDispatcherQPA()
@ -241,8 +240,8 @@ bool QEventDispatcherQPA::processEvents(QEventLoop::ProcessEventsFlags flags)
} }
if (!d->interrupt) { if (!d->interrupt) {
if (QEventDispatcherUNIX::processEvents(flags)) { if (EVENTDISPATCHERBASE::processEvents(flags)) {
QEventDispatcherUNIX::processEvents(flags); EVENTDISPATCHERBASE::processEvents(flags);
return true; return true;
} }
} }
@ -258,7 +257,7 @@ bool QEventDispatcherQPA::hasPendingEvents()
void QEventDispatcherQPA::registerSocketNotifier(QSocketNotifier *notifier) void QEventDispatcherQPA::registerSocketNotifier(QSocketNotifier *notifier)
{ {
Q_D(QEventDispatcherQPA); Q_D(QEventDispatcherQPA);
QEventDispatcherUNIX::registerSocketNotifier(notifier); EVENTDISPATCHERBASE::registerSocketNotifier(notifier);
if (d->hasIntegration()) if (d->hasIntegration())
wakeUp(); wakeUp();
@ -267,7 +266,7 @@ void QEventDispatcherQPA::registerSocketNotifier(QSocketNotifier *notifier)
void QEventDispatcherQPA::unregisterSocketNotifier(QSocketNotifier *notifier) void QEventDispatcherQPA::unregisterSocketNotifier(QSocketNotifier *notifier)
{ {
Q_D(QEventDispatcherQPA); Q_D(QEventDispatcherQPA);
QEventDispatcherUNIX::unregisterSocketNotifier(notifier); EVENTDISPATCHERBASE::unregisterSocketNotifier(notifier);
if (d->hasIntegration()) if (d->hasIntegration())
wakeUp(); wakeUp();
} }
@ -307,7 +306,11 @@ int QEventDispatcherQPA::select(int nfds, fd_set *readfds, fd_set *writefds, fd_
d->eventLoopIntegration->setNextTimerEvent(timeoutmsec); d->eventLoopIntegration->setNextTimerEvent(timeoutmsec);
retVal = 0; //is 0 if select has not returned retVal = 0; //is 0 if select has not returned
} else { } else {
retVal = QEventDispatcherUNIX::select(nfds, readfds, writefds, exceptfds, timeout); #if defined(Q_OS_UNIX)
retVal = EVENTDISPATCHERBASE::select(nfds, readfds, writefds, exceptfds, timeout);
#elif defined(Q_OS_WIN)
// ### TODO
#endif
} }
return retVal; return retVal;
} }
@ -319,7 +322,12 @@ void SelectWorker::run()
while(true) { while(true) {
m_retVal = 0; m_retVal = 0;
m_edPrivate->barrierBeforeBlocking->checkpoint(); // wait for mainthread m_edPrivate->barrierBeforeBlocking->checkpoint(); // wait for mainthread
#if defined(Q_OS_UNIX)
int tmpRet = qt_safe_select(m_nfds,m_readfds,m_writefds,m_exceptfds,0); int tmpRet = qt_safe_select(m_nfds,m_readfds,m_writefds,m_exceptfds,0);
#elif defined(Q_OS_WIN)
// ### TODO
int tmpRet = 0;
#endif
m_edPrivate->selectReturnMutex->lock(); m_edPrivate->selectReturnMutex->lock();
m_edPrivate->eventLoopIntegration->qtNeedsToProcessEvents(); m_edPrivate->eventLoopIntegration->qtNeedsToProcessEvents();

View File

@ -53,13 +53,21 @@
// We mean it. // We mean it.
// //
#if defined(Q_OS_UNIX)
#include "private/qeventdispatcher_unix_p.h" #include "private/qeventdispatcher_unix_p.h"
#define EVENTDISPATCHERBASE QEventDispatcherUNIX
#define EVENTDISPATCHERBASEPRIVATE QEventDispatcherUNIXPrivate
#elif defined(Q_OS_WIN)
#include "private/qeventdispatcher_win_p.h"
#define EVENTDISPATCHERBASE QEventDispatcherWin32
#define EVENTDISPATCHERBASEPRIVATE QEventDispatcherWin32Private
#endif
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
class QEventDispatcherQPAPrivate; class QEventDispatcherQPAPrivate;
class QEventDispatcherQPA : public QEventDispatcherUNIX class QEventDispatcherQPA : public EVENTDISPATCHERBASE
{ {
Q_OBJECT Q_OBJECT
Q_DECLARE_PRIVATE(QEventDispatcherQPA) Q_DECLARE_PRIVATE(QEventDispatcherQPA)

View File

@ -240,7 +240,7 @@ static void init_plugins(const QList<QByteArray> pluginList)
void QGuiApplicationPrivate::createEventDispatcher() void QGuiApplicationPrivate::createEventDispatcher()
{ {
Q_Q(QGuiApplication); Q_Q(QGuiApplication);
#if !defined(QT_NO_GLIB) #if !defined(QT_NO_GLIB) && !defined(Q_OS_WIN)
if (qgetenv("QT_NO_GLIB").isEmpty() && QEventDispatcherGlib::versionSupported()) if (qgetenv("QT_NO_GLIB").isEmpty() && QEventDispatcherGlib::versionSupported())
eventDispatcher = new QPAEventDispatcherGlib(q); eventDispatcher = new QPAEventDispatcherGlib(q);
else else

View File

@ -133,7 +133,7 @@ Q_GUI_EXPORT bool operator==(const QWindowFormat&, const QWindowFormat&);
Q_GUI_EXPORT bool operator!=(const QWindowFormat&, const QWindowFormat&); Q_GUI_EXPORT bool operator!=(const QWindowFormat&, const QWindowFormat&);
#ifndef QT_NO_DEBUG_STREAM #ifndef QT_NO_DEBUG_STREAM
Q_OPENGL_EXPORT QDebug operator<<(QDebug, const QWindowFormat &); Q_GUI_EXPORT QDebug operator<<(QDebug, const QWindowFormat &);
#endif #endif
Q_DECLARE_OPERATORS_FOR_FLAGS(QWindowFormat::FormatOptions) Q_DECLARE_OPERATORS_FOR_FLAGS(QWindowFormat::FormatOptions)

View File

@ -94,7 +94,7 @@ SOURCES += \
painting/qpaintengine_blitter_p.h \ painting/qpaintengine_blitter_p.h \
painting/qblittable_p.h \ painting/qblittable_p.h \
win32 { win32:!qpa {
HEADERS += painting/qprintengine_win_p.h HEADERS += painting/qprintengine_win_p.h
SOURCES += \ SOURCES += \
@ -131,7 +131,7 @@ unix:x11 {
painting/qprintengine_mac.mm \ painting/qprintengine_mac.mm \
} }
unix:!mac:!symbian|qpa { unix:!mac:!symbian {
HEADERS += \ HEADERS += \
painting/qprinterinfo_unix_p.h painting/qprinterinfo_unix_p.h
SOURCES += \ SOURCES += \
@ -154,7 +154,7 @@ symbian {
painting/qpaintengine_s60_p.h painting/qpaintengine_s60_p.h
} }
x11|qpa { x11|qpa:!win32 {
contains(QT_CONFIG,qtopia) { contains(QT_CONFIG,qtopia) {
DEFINES += QT_NO_CUPS QT_NO_LPR DEFINES += QT_NO_CUPS QT_NO_LPR
} else { } else {

View File

@ -70,7 +70,7 @@ QT_BEGIN_NAMESPACE
#endif #endif
#endif #endif
#ifdef Q_WS_QWS #if defined(Q_WS_QWS) || defined(Q_WS_QPA) && defined(Q_OS_WIN)
#define Q_GUI_QWS_EXPORT Q_GUI_EXPORT #define Q_GUI_QWS_EXPORT Q_GUI_EXPORT
#else #else
#define Q_GUI_QWS_EXPORT #define Q_GUI_QWS_EXPORT

View File

@ -542,7 +542,7 @@ QRegion& QRegion::operator|=(const QRegion &r)
\sa intersected() \sa intersected()
*/ */
#if !defined (Q_OS_UNIX) && !defined (Q_WS_WIN) #if !defined (Q_OS_UNIX) && !defined (Q_OS_WIN)
QRegion& QRegion::operator+=(const QRect &r) QRegion& QRegion::operator+=(const QRect &r)
{ {
return operator+=(QRegion(r)); return operator+=(QRegion(r));
@ -565,7 +565,7 @@ QRegion& QRegion::operator&=(const QRegion &r)
\overload \overload
\since 4.4 \since 4.4
*/ */
#if defined (Q_OS_UNIX) || defined (Q_WS_WIN) #if defined (Q_OS_UNIX) || defined (Q_OS_WIN)
QRegion& QRegion::operator&=(const QRect &r) QRegion& QRegion::operator&=(const QRect &r)
{ {
return *this = *this & r; return *this = *this & r;
@ -709,7 +709,7 @@ bool QRegion::intersects(const QRegion &region) const
*/ */
#if !defined (Q_OS_UNIX) && !defined (Q_WS_WIN) #if !defined (Q_OS_UNIX) && !defined (Q_OS_WIN)
/*! /*!
\overload \overload
\since 4.4 \since 4.4
@ -1072,7 +1072,7 @@ Q_AUTOTEST_EXPORT QPainterPath qt_regionToPath(const QRegion &region)
return result; return result;
} }
#if defined(Q_OS_UNIX) || defined(Q_WS_WIN) #if defined(Q_OS_UNIX) || defined(Q_OS_WIN)
//#define QT_REGION_DEBUG //#define QT_REGION_DEBUG
/* /*

View File

@ -183,6 +183,9 @@ private:
#elif defined(Q_WS_MAC) #elif defined(Q_WS_MAC)
static OSStatus shape2QRegionHelper(int inMessage, HIShapeRef inShape, static OSStatus shape2QRegionHelper(int inMessage, HIShapeRef inShape,
const CGRect *inRect, void *inRefcon); const CGRect *inRect, void *inRefcon);
#endif
#if defined(Q_WS_QWS) || defined(Q_WS_QPA)
Q_GUI_EXPORT
#endif #endif
friend bool qt_region_strictContains(const QRegion &region, friend bool qt_region_strictContains(const QRegion &region,
const QRect &rect); const QRect &rect);

View File

@ -74,7 +74,7 @@ SOURCES += \
text/qrawfont.cpp \ text/qrawfont.cpp \
text/qglyphrun.cpp text/qglyphrun.cpp
win32 { win32:!qpa {
SOURCES += \ SOURCES += \
text/qfont_win.cpp \ text/qfont_win.cpp \
text/qfontengine_win.cpp \ text/qfontengine_win.cpp \

View File

@ -41,6 +41,7 @@
#include <qcoreapplication.h> #include <qcoreapplication.h>
#include <qdir.h> #include <qdir.h>
#include <qurl.h>
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE