summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
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/kernel
parent07818c429c6abaa7b7246d3e7cdcfbe642304145 (diff)
Compile fix for QtGui when configure with -qpa on Windows
Reviewed-by: Friedemann Kleint
Diffstat (limited to 'src/gui/kernel')
-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
4 files changed, 27 insertions, 11 deletions
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)