summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorOlli Werwolff <qt-info@nokia.com>2011-05-25 10:11:58 +0200
committerOlli Werwolff <qt-info@nokia.com>2011-05-26 08:50:23 +0200
commited529bbf4992a12163070c9a92af1a6a4e5b97aa (patch)
treeaba91d1ac768cb8853ac4f6bc3b7ae1db6bc1ab1 /src/gui
parent07818c429c6abaa7b7246d3e7cdcfbe642304145 (diff)
Compile fix for QtGui when configure with -qpa on Windows
Reviewed-by: Friedemann Kleint
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/image/image.pri8
-rw-r--r--src/gui/kernel/qeventdispatcher_qpa.cpp24
-rw-r--r--src/gui/kernel/qeventdispatcher_qpa_p.h10
-rw-r--r--src/gui/kernel/qguiapplication.cpp2
-rw-r--r--src/gui/kernel/qwindowformat_qpa.h2
-rw-r--r--src/gui/painting/painting.pri6
-rw-r--r--src/gui/painting/qmemrotate_p.h2
-rw-r--r--src/gui/painting/qregion.cpp8
-rw-r--r--src/gui/painting/qregion.h3
-rw-r--r--src/gui/text/text.pri2
-rw-r--r--src/gui/util/qdesktopservices_qpa.cpp1
11 files changed, 44 insertions, 24 deletions
diff --git a/src/gui/image/image.pri b/src/gui/image/image.pri
index 25da543b08..27aac41ebe 100644
--- a/src/gui/image/image.pri
+++ b/src/gui/image/image.pri
@@ -48,12 +48,12 @@ SOURCES += \
image/qimagepixmapcleanuphooks.cpp \
image/qvolatileimage.cpp
-win32 {
- SOURCES += image/qpixmap_win.cpp
-}
-else:qpa {
+qpa: {
SOURCES += image/qpixmap_qpa.cpp
}
+else:win32 {
+ SOURCES += image/qpixmap_win.cpp
+}
else:x11 {
HEADERS += image/qpixmap_x11_p.h
SOURCES += image/qpixmap_x11.cpp
diff --git a/src/gui/kernel/qeventdispatcher_qpa.cpp b/src/gui/kernel/qeventdispatcher_qpa.cpp
index fe08938f59..d769b229c0 100644
--- a/src/gui/kernel/qeventdispatcher_qpa.cpp
+++ b/src/gui/kernel/qeventdispatcher_qpa.cpp
@@ -42,7 +42,6 @@
#include "qplatformdefs.h"
#include "qcoreapplication.h"
#include "qeventdispatcher_qpa_p.h"
-#include "private/qeventdispatcher_unix_p.h"
#include "private/qguiapplication_p.h"
#include "qplatformeventloopintegration_qpa.h"
@@ -112,7 +111,7 @@ private:
fd_set *m_readfds, *m_writefds, *m_exceptfds;
};
-class QEventDispatcherQPAPrivate : public QEventDispatcherUNIXPrivate
+class QEventDispatcherQPAPrivate : public EVENTDISPATCHERBASEPRIVATE
{
Q_DECLARE_PUBLIC(QEventDispatcherQPA)
public:
@@ -192,7 +191,7 @@ private:
};
QEventDispatcherQPA::QEventDispatcherQPA(QObject *parent)
- : QEventDispatcherUNIX(*new QEventDispatcherQPAPrivate, parent)
+ : EVENTDISPATCHERBASE(*new QEventDispatcherQPAPrivate, parent)
{ }
QEventDispatcherQPA::~QEventDispatcherQPA()
@@ -241,8 +240,8 @@ bool QEventDispatcherQPA::processEvents(QEventLoop::ProcessEventsFlags flags)
}
if (!d->interrupt) {
- if (QEventDispatcherUNIX::processEvents(flags)) {
- QEventDispatcherUNIX::processEvents(flags);
+ if (EVENTDISPATCHERBASE::processEvents(flags)) {
+ EVENTDISPATCHERBASE::processEvents(flags);
return true;
}
}
@@ -258,7 +257,7 @@ bool QEventDispatcherQPA::hasPendingEvents()
void QEventDispatcherQPA::registerSocketNotifier(QSocketNotifier *notifier)
{
Q_D(QEventDispatcherQPA);
- QEventDispatcherUNIX::registerSocketNotifier(notifier);
+ EVENTDISPATCHERBASE::registerSocketNotifier(notifier);
if (d->hasIntegration())
wakeUp();
@@ -267,7 +266,7 @@ void QEventDispatcherQPA::registerSocketNotifier(QSocketNotifier *notifier)
void QEventDispatcherQPA::unregisterSocketNotifier(QSocketNotifier *notifier)
{
Q_D(QEventDispatcherQPA);
- QEventDispatcherUNIX::unregisterSocketNotifier(notifier);
+ EVENTDISPATCHERBASE::unregisterSocketNotifier(notifier);
if (d->hasIntegration())
wakeUp();
}
@@ -307,7 +306,11 @@ int QEventDispatcherQPA::select(int nfds, fd_set *readfds, fd_set *writefds, fd_
d->eventLoopIntegration->setNextTimerEvent(timeoutmsec);
retVal = 0; //is 0 if select has not returned
} 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;
}
@@ -319,7 +322,12 @@ void SelectWorker::run()
while(true) {
m_retVal = 0;
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);
+#elif defined(Q_OS_WIN)
+ // ### TODO
+ int tmpRet = 0;
+#endif
m_edPrivate->selectReturnMutex->lock();
m_edPrivate->eventLoopIntegration->qtNeedsToProcessEvents();
diff --git a/src/gui/kernel/qeventdispatcher_qpa_p.h b/src/gui/kernel/qeventdispatcher_qpa_p.h
index c145e389f6..74522477e8 100644
--- a/src/gui/kernel/qeventdispatcher_qpa_p.h
+++ b/src/gui/kernel/qeventdispatcher_qpa_p.h
@@ -53,13 +53,21 @@
// We mean it.
//
+#if defined(Q_OS_UNIX)
#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
class QEventDispatcherQPAPrivate;
-class QEventDispatcherQPA : public QEventDispatcherUNIX
+class QEventDispatcherQPA : public EVENTDISPATCHERBASE
{
Q_OBJECT
Q_DECLARE_PRIVATE(QEventDispatcherQPA)
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index f2d13d47a2..d837fb0800 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -240,7 +240,7 @@ static void init_plugins(const QList<QByteArray> pluginList)
void QGuiApplicationPrivate::createEventDispatcher()
{
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())
eventDispatcher = new QPAEventDispatcherGlib(q);
else
diff --git a/src/gui/kernel/qwindowformat_qpa.h b/src/gui/kernel/qwindowformat_qpa.h
index 9bc2ccdfaa..e3214cceca 100644
--- a/src/gui/kernel/qwindowformat_qpa.h
+++ b/src/gui/kernel/qwindowformat_qpa.h
@@ -133,7 +133,7 @@ Q_GUI_EXPORT bool operator==(const QWindowFormat&, const QWindowFormat&);
Q_GUI_EXPORT bool operator!=(const QWindowFormat&, const QWindowFormat&);
#ifndef QT_NO_DEBUG_STREAM
-Q_OPENGL_EXPORT QDebug operator<<(QDebug, const QWindowFormat &);
+Q_GUI_EXPORT QDebug operator<<(QDebug, const QWindowFormat &);
#endif
Q_DECLARE_OPERATORS_FOR_FLAGS(QWindowFormat::FormatOptions)
diff --git a/src/gui/painting/painting.pri b/src/gui/painting/painting.pri
index 5379b6545e..3e284c04c1 100644
--- a/src/gui/painting/painting.pri
+++ b/src/gui/painting/painting.pri
@@ -94,7 +94,7 @@ SOURCES += \
painting/qpaintengine_blitter_p.h \
painting/qblittable_p.h \
-win32 {
+win32:!qpa {
HEADERS += painting/qprintengine_win_p.h
SOURCES += \
@@ -131,7 +131,7 @@ unix:x11 {
painting/qprintengine_mac.mm \
}
-unix:!mac:!symbian|qpa {
+unix:!mac:!symbian {
HEADERS += \
painting/qprinterinfo_unix_p.h
SOURCES += \
@@ -154,7 +154,7 @@ symbian {
painting/qpaintengine_s60_p.h
}
-x11|qpa {
+x11|qpa:!win32 {
contains(QT_CONFIG,qtopia) {
DEFINES += QT_NO_CUPS QT_NO_LPR
} else {
diff --git a/src/gui/painting/qmemrotate_p.h b/src/gui/painting/qmemrotate_p.h
index 019576a446..84b0b01846 100644
--- a/src/gui/painting/qmemrotate_p.h
+++ b/src/gui/painting/qmemrotate_p.h
@@ -70,7 +70,7 @@ QT_BEGIN_NAMESPACE
#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
#else
#define Q_GUI_QWS_EXPORT
diff --git a/src/gui/painting/qregion.cpp b/src/gui/painting/qregion.cpp
index 7166ec7e12..0e58331768 100644
--- a/src/gui/painting/qregion.cpp
+++ b/src/gui/painting/qregion.cpp
@@ -542,7 +542,7 @@ QRegion& QRegion::operator|=(const QRegion &r)
\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)
{
return operator+=(QRegion(r));
@@ -565,7 +565,7 @@ QRegion& QRegion::operator&=(const QRegion &r)
\overload
\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)
{
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
\since 4.4
@@ -1072,7 +1072,7 @@ Q_AUTOTEST_EXPORT QPainterPath qt_regionToPath(const QRegion &region)
return result;
}
-#if defined(Q_OS_UNIX) || defined(Q_WS_WIN)
+#if defined(Q_OS_UNIX) || defined(Q_OS_WIN)
//#define QT_REGION_DEBUG
/*
diff --git a/src/gui/painting/qregion.h b/src/gui/painting/qregion.h
index 2a9a98d99a..75d29e1ef5 100644
--- a/src/gui/painting/qregion.h
+++ b/src/gui/painting/qregion.h
@@ -184,6 +184,9 @@ private:
static OSStatus shape2QRegionHelper(int inMessage, HIShapeRef inShape,
const CGRect *inRect, void *inRefcon);
#endif
+#if defined(Q_WS_QWS) || defined(Q_WS_QPA)
+Q_GUI_EXPORT
+#endif
friend bool qt_region_strictContains(const QRegion &region,
const QRect &rect);
friend struct QRegionPrivate;
diff --git a/src/gui/text/text.pri b/src/gui/text/text.pri
index 6357dec1d2..23c863392a 100644
--- a/src/gui/text/text.pri
+++ b/src/gui/text/text.pri
@@ -74,7 +74,7 @@ SOURCES += \
text/qrawfont.cpp \
text/qglyphrun.cpp
-win32 {
+win32:!qpa {
SOURCES += \
text/qfont_win.cpp \
text/qfontengine_win.cpp \
diff --git a/src/gui/util/qdesktopservices_qpa.cpp b/src/gui/util/qdesktopservices_qpa.cpp
index e3847e5bfd..374b06b4f0 100644
--- a/src/gui/util/qdesktopservices_qpa.cpp
+++ b/src/gui/util/qdesktopservices_qpa.cpp
@@ -41,6 +41,7 @@
#include <qcoreapplication.h>
#include <qdir.h>
+#include <qurl.h>
QT_BEGIN_NAMESPACE