summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/global/qglobal.h27
-rw-r--r--src/corelib/global/qnamespace.h68
-rw-r--r--src/corelib/global/qt_pch.h2
-rw-r--r--src/corelib/io/qdir.cpp2
-rw-r--r--src/corelib/io/qfsfileengine_p.h4
-rw-r--r--src/corelib/io/qprocess.cpp6
-rw-r--r--src/corelib/kernel/qcoreapplication.cpp34
-rw-r--r--src/corelib/kernel/qcoreapplication.h21
-rw-r--r--src/corelib/kernel/qcoreapplication_p.h2
-rw-r--r--src/corelib/kernel/qcoreapplication_win.cpp2
-rw-r--r--src/corelib/kernel/qcoreevent.h5
-rw-r--r--src/corelib/kernel/qeventdispatcher_win.cpp74
-rw-r--r--src/corelib/kernel/qeventdispatcher_win_p.h71
-rw-r--r--src/corelib/kernel/qmetatype.cpp41
-rw-r--r--src/corelib/kernel/qmetatype.h19
-rw-r--r--src/corelib/kernel/qobject.cpp1
-rw-r--r--src/corelib/kernel/qobject.h4
-rw-r--r--src/corelib/kernel/qvariant.h45
-rw-r--r--src/corelib/plugin/qlibrary_p.h4
-rw-r--r--src/corelib/thread/qthread.cpp4
-rw-r--r--src/corelib/tools/qdatetime.cpp4
-rw-r--r--src/corelib/tools/qlocale.cpp11
22 files changed, 215 insertions, 236 deletions
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index 64baf3a026..1c82003b1c 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -855,7 +855,9 @@ namespace QT_NAMESPACE {}
WIN16 - unsupported
*/
-#if defined(Q_OS_MSDOS)
+#if defined (Q_WS_QPA)
+
+#elif defined(Q_OS_MSDOS)
# define Q_WS_WIN16
# error "Qt requires Win32 and does not work with Windows 3.x"
#elif defined(_WIN32_X11_)
@@ -1138,7 +1140,7 @@ redefine to built-in booleans to make autotests work properly */
//defines the type for the WNDPROC on windows
//the alignment needs to be forced for sse2 to not crash with mingw
-#if defined(Q_WS_WIN)
+#if defined(Q_OS_WIN)
# if defined(Q_CC_MINGW)
# define QT_ENSURE_STACK_ALIGNED_FOR_SSE __attribute__ ((force_align_arg_pointer))
# else
@@ -1297,6 +1299,11 @@ class QDataStream;
# else
# define Q_GUI_EXPORT Q_DECL_IMPORT
# endif
+# if defined(QT_BUILD_WIDGETS_LIB)
+# define Q_WIDGETS_EXPORT Q_DECL_EXPORT
+# else
+# define Q_WIDGETS_EXPORT Q_DECL_IMPORT
+# endif
# if defined(QT_BUILD_SQL_LIB)
# define Q_SQL_EXPORT Q_DECL_EXPORT
# else
@@ -1381,6 +1388,7 @@ class QDataStream;
# elif defined(QT_DLL) /* use a Qt DLL library */
# define Q_CORE_EXPORT Q_DECL_IMPORT
# define Q_GUI_EXPORT Q_DECL_IMPORT
+# define Q_WIDGETS_EXPORT Q_DECL_IMPORT
# define Q_SQL_EXPORT Q_DECL_IMPORT
# define Q_NETWORK_EXPORT Q_DECL_IMPORT
# define Q_SVG_EXPORT Q_DECL_IMPORT
@@ -1413,6 +1421,7 @@ class QDataStream;
# if defined(QT_SHARED)
# define Q_CORE_EXPORT Q_DECL_EXPORT
# define Q_GUI_EXPORT Q_DECL_EXPORT
+# define Q_WIDGETS_EXPORT Q_DECL_EXPORT
# define Q_SQL_EXPORT Q_DECL_EXPORT
# define Q_NETWORK_EXPORT Q_DECL_EXPORT
# define Q_SVG_EXPORT Q_DECL_EXPORT
@@ -1431,6 +1440,7 @@ class QDataStream;
# else
# define Q_CORE_EXPORT
# define Q_GUI_EXPORT
+# define Q_WIDGETS_EXPORT
# define Q_SQL_EXPORT
# define Q_NETWORK_EXPORT
# define Q_SVG_EXPORT
@@ -1461,6 +1471,11 @@ class QDataStream;
# else
# define Q_GUI_EXPORT_INLINE inline
# endif
+# if defined(QT_BUILD_WIDGETS_LIB)
+# define Q_WIDGETS_EXPORT_INLINE Q_WIDGETS_EXPORT inline
+# else
+# define Q_WIDGETS_EXPORT_INLINE inline
+# endif
# if defined(QT_BUILD_COMPAT_LIB)
# define Q_COMPAT_EXPORT_INLINE Q_COMPAT_EXPORT inline
# else
@@ -1472,10 +1487,12 @@ class QDataStream;
// note: this affects the contents of the DEF files (ie. these functions do not appear)
# define Q_CORE_EXPORT_INLINE inline
# define Q_GUI_EXPORT_INLINE inline
+# define Q_WIDGETS_EXPORT_INLINE inline
# define Q_COMPAT_EXPORT_INLINE inline
#else
# define Q_CORE_EXPORT_INLINE Q_CORE_EXPORT inline
# define Q_GUI_EXPORT_INLINE Q_GUI_EXPORT inline
+# define Q_WIDGETS_EXPORT_INLINE Q_WIDGETS_EXPORT inline
# define Q_COMPAT_EXPORT_INLINE Q_COMPAT_EXPORT inline
#endif
@@ -1559,7 +1576,7 @@ public:
#else
# error "Qt not configured correctly, please run configure"
#endif
-#if defined(Q_WS_WIN) || defined(Q_OS_CYGWIN)
+#if defined(Q_OS_WIN) || defined(Q_OS_CYGWIN)
enum WinVersion {
WV_32s = 0x0001,
WV_95 = 0x0002,
@@ -1668,7 +1685,7 @@ inline QT3_SUPPORT bool qSysInfo(int *wordSize, bool *bigEndian)
}
#endif
-#if defined(Q_WS_WIN) || defined(Q_OS_CYGWIN)
+#if defined(Q_OS_WIN) || defined(Q_OS_CYGWIN)
#if defined(QT3_SUPPORT)
inline QT3_SUPPORT bool qt_winUnicode() { return true; }
inline QT3_SUPPORT int qWinVersion() { return QSysInfo::WindowsVersion; }
@@ -1678,7 +1695,7 @@ inline QT3_SUPPORT int qWinVersion() { return QSysInfo::WindowsVersion; }
#define QT_WA(unicode, ansi) unicode
#define QT_WA_INLINE(unicode, ansi) (unicode)
-#endif /* Q_WS_WIN */
+#endif /* Q_OS_WIN */
#ifndef Q_OUTOFLINE_TEMPLATE
# define Q_OUTOFLINE_TEMPLATE
diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h
index 99479d0b63..4a663fc8a5 100644
--- a/src/corelib/global/qnamespace.h
+++ b/src/corelib/global/qnamespace.h
@@ -272,13 +272,13 @@ public:
Window = 0x00000001,
Dialog = 0x00000002 | Window,
Sheet = 0x00000004 | Window,
- Drawer = 0x00000006 | Window,
+ Drawer = Sheet | Dialog,
Popup = 0x00000008 | Window,
- Tool = 0x0000000a | Window,
- ToolTip = 0x0000000c | Window,
- SplashScreen = 0x0000000e | Window,
+ Tool = Popup | Dialog,
+ ToolTip = Popup | Sheet,
+ SplashScreen = ToolTip | Dialog,
Desktop = 0x00000010 | Window,
- SubWindow = 0x00000012,
+ SubWindow = 0x00000012,
WindowType_Mask = 0x000000ff,
MSWindowsFixedSizeDialogHint = 0x00000100,
@@ -293,13 +293,7 @@ public:
WindowContextHelpButtonHint = 0x00010000,
WindowShadeButtonHint = 0x00020000,
WindowStaysOnTopHint = 0x00040000,
- // reserved for Qt3Support:
- // WMouseNoMask = 0x00080000,
- // WDestructiveClose = 0x00100000,
- // WStaticContents = 0x00200000,
- // WGroupLeader = 0x00400000,
- // WShowModal = 0x00800000,
- // WNoMousePropagation = 0x01000000,
+
CustomizeWindowHint = 0x02000000,
WindowStaysOnBottomHint = 0x04000000,
WindowCloseButtonHint = 0x08000000,
@@ -309,56 +303,6 @@ public:
WindowCancelButtonHint = 0x00100000,
WindowSoftkeysVisibleHint = 0x40000000,
WindowSoftkeysRespondHint = 0x80000000
-
-#ifdef QT3_SUPPORT
- ,
- WMouseNoMask = 0x00080000,
- WDestructiveClose = 0x00100000,
- WStaticContents = 0x00200000,
- WGroupLeader = 0x00400000,
- WShowModal = 0x00800000,
- WNoMousePropagation = 0x01000000,
-
- WType_TopLevel = Window,
- WType_Dialog = Dialog,
- WType_Popup = Popup,
- WType_Desktop = Desktop,
- WType_Mask = WindowType_Mask,
-
- WStyle_Customize = 0,
- WStyle_NormalBorder = 0,
- WStyle_DialogBorder = MSWindowsFixedSizeDialogHint,
- WStyle_NoBorder = FramelessWindowHint,
- WStyle_Title = WindowTitleHint,
- WStyle_SysMenu = WindowSystemMenuHint,
- WStyle_Minimize = WindowMinimizeButtonHint,
- WStyle_Maximize = WindowMaximizeButtonHint,
- WStyle_MinMax = WStyle_Minimize | WStyle_Maximize,
- WStyle_Tool = Tool,
- WStyle_StaysOnTop = WindowStaysOnTopHint,
- WStyle_ContextHelp = WindowContextHelpButtonHint,
-
- // misc flags
- WPaintDesktop = 0,
- WPaintClever = 0,
-
- WX11BypassWM = X11BypassWindowManagerHint,
- WWinOwnDC = MSWindowsOwnDC,
- WMacSheet = Sheet,
- WMacDrawer = Drawer,
-
- WStyle_Splash = SplashScreen,
-
- WNoAutoErase = 0,
- WRepaintNoErase = 0,
- WNorthWestGravity = WStaticContents,
- WType_Modal = Dialog | WShowModal,
- WStyle_Dialog = Dialog,
- WStyle_NoBorderEx = FramelessWindowHint,
- WResizeNoErase = 0,
- WMacNoSheet = 0
-#endif
-
};
Q_DECLARE_FLAGS(WindowFlags, WindowType)
diff --git a/src/corelib/global/qt_pch.h b/src/corelib/global/qt_pch.h
index 738026a9ed..0926e02af1 100644
--- a/src/corelib/global/qt_pch.h
+++ b/src/corelib/global/qt_pch.h
@@ -50,7 +50,7 @@
#if defined __cplusplus
#include <qglobal.h>
-#ifdef Q_WS_WIN
+#ifdef Q_OS_WIN
# define _POSIX_
# include <limits.h>
# undef _POSIX_
diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp
index b31cf69e26..9426618875 100644
--- a/src/corelib/io/qdir.cpp
+++ b/src/corelib/io/qdir.cpp
@@ -1746,7 +1746,7 @@ QFileInfoList QDir::drives()
*/
QChar QDir::separator()
{
-#if defined (Q_FS_FAT) || defined(Q_WS_WIN) || defined(Q_OS_SYMBIAN)
+#if defined (Q_FS_FAT) || defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
return QLatin1Char('\\');
#elif defined(Q_OS_UNIX)
return QLatin1Char('/');
diff --git a/src/corelib/io/qfsfileengine_p.h b/src/corelib/io/qfsfileengine_p.h
index 79dda1b70a..89c08aeca7 100644
--- a/src/corelib/io/qfsfileengine_p.h
+++ b/src/corelib/io/qfsfileengine_p.h
@@ -77,7 +77,7 @@ class Q_AUTOTEST_EXPORT QFSFileEnginePrivate : public QAbstractFileEnginePrivate
Q_DECLARE_PUBLIC(QFSFileEngine)
public:
-#ifdef Q_WS_WIN
+#ifdef Q_OS_WIN
static QString longFileName(const QString &path);
#endif
@@ -143,7 +143,7 @@ public:
int getMapHandle();
#endif
-#ifdef Q_WS_WIN
+#ifdef Q_OS_WIN
HANDLE fileHandle;
HANDLE mapHandle;
QHash<uchar *, DWORD /* offset % AllocationGranularity */> maps;
diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp
index 70a70c27d8..a14c4fdc7d 100644
--- a/src/corelib/io/qprocess.cpp
+++ b/src/corelib/io/qprocess.cpp
@@ -93,7 +93,7 @@ QT_END_NAMESPACE
#include <qsocketnotifier.h>
#include <qtimer.h>
-#ifdef Q_WS_WIN
+#ifdef Q_OS_WIN
#include <private/qwineventnotifier_p.h>
#endif
@@ -764,10 +764,10 @@ QProcessPrivate::QProcessPrivate()
dying = false;
emittedReadyRead = false;
emittedBytesWritten = false;
-#ifdef Q_WS_WIN
+#ifdef Q_OS_WIN
pipeWriter = 0;
processFinishedNotifier = 0;
-#endif // Q_WS_WIN
+#endif // Q_OS_WIN
#ifdef Q_OS_UNIX
serial = 0;
#endif
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
index a8c40c5180..e00db5e01a 100644
--- a/src/corelib/kernel/qcoreapplication.cpp
+++ b/src/corelib/kernel/qcoreapplication.cpp
@@ -171,7 +171,7 @@ CApaCommandLine* QCoreApplicationPrivate::symbianCommandLine()
#endif
-#if defined(Q_WS_WIN) || defined(Q_WS_MAC)
+#if defined(Q_OS_WIN) || defined(Q_WS_MAC)
extern QString qAppFileName();
#endif
@@ -334,7 +334,7 @@ Q_GLOBAL_STATIC(QCoreApplicationData, coreappdata)
QCoreApplicationPrivate::QCoreApplicationPrivate(int &aargc, char **aargv, uint flags)
: QObjectPrivate(), argc(aargc), argv(aargv), application_type(0), eventFilter(0),
- in_exec(false), aboutToQuitEmitted(false)
+ in_exec(false), aboutToQuitEmitted(false), threadData_clean(false)
{
app_compile_version = flags & 0xffffff;
#if defined(QT3_SUPPORT)
@@ -362,7 +362,12 @@ QCoreApplicationPrivate::QCoreApplicationPrivate(int &aargc, char **aargv, uint
QCoreApplicationPrivate::~QCoreApplicationPrivate()
{
- if (threadData) {
+ cleanupThreadData();
+}
+
+void QCoreApplicationPrivate::cleanupThreadData()
+{
+ if (threadData && !threadData_clean) {
#ifndef QT_NO_THREAD
void *data = &threadData->tls;
QThreadStorageData::finish((void **)data);
@@ -381,6 +386,7 @@ QCoreApplicationPrivate::~QCoreApplicationPrivate()
threadData->postEventList.clear();
threadData->postEventList.recursion = 0;
threadData->quitNow = false;
+ threadData_clean = true;
}
}
@@ -596,23 +602,6 @@ void QCoreApplication::flush()
\a argc must be greater than zero and \a argv must contain at least
one valid character string.
*/
-QCoreApplication::QCoreApplication(int &argc, char **argv)
- : QObject(*new QCoreApplicationPrivate(argc, argv, 0x040000))
-{
- init();
- QCoreApplicationPrivate::eventDispatcher->startingUp();
-#if defined(Q_OS_SYMBIAN) && !defined(QT_NO_LIBRARY)
- // Refresh factoryloader, as text codecs are requested during lib path
- // resolving process and won't be therefore properly loaded.
- // Unknown if this is symbian specific issue.
- QFactoryLoader::refreshAll();
-#endif
-
-#if defined(Q_OS_SYMBIAN) && !defined(QT_NO_SYSTEMLOCALE)
- d_func()->symbianInit();
-#endif
-}
-
QCoreApplication::QCoreApplication(int &argc, char **argv, int _internal)
: QObject(*new QCoreApplicationPrivate(argc, argv, _internal))
{
@@ -1302,7 +1291,7 @@ void QCoreApplication::postEvent(QObject *receiver, QEvent *event, int priority)
*/
bool QCoreApplication::compressEvent(QEvent *event, QObject *receiver, QPostEventList *postedEvents)
{
-#ifdef Q_WS_WIN
+#ifdef Q_OS_WIN
Q_ASSERT(event);
Q_ASSERT(receiver);
Q_ASSERT(postedEvents);
@@ -2008,7 +1997,7 @@ QString QCoreApplication::applicationFilePath()
if (!d->cachedApplicationFilePath.isNull())
return d->cachedApplicationFilePath;
-#if defined(Q_WS_WIN)
+#if defined(Q_OS_WIN)
d->cachedApplicationFilePath = QFileInfo(qAppFileName()).filePath();
return d->cachedApplicationFilePath;
#elif defined(Q_WS_MAC)
@@ -2203,7 +2192,6 @@ QStringList QCoreApplication::arguments()
;
else if (l1arg == "-style" ||
l1arg == "-session" ||
- l1arg == "-graphicssystem" ||
l1arg == "-testability")
++a;
else
diff --git a/src/corelib/kernel/qcoreapplication.h b/src/corelib/kernel/qcoreapplication.h
index d4356e3e36..1dea3578c0 100644
--- a/src/corelib/kernel/qcoreapplication.h
+++ b/src/corelib/kernel/qcoreapplication.h
@@ -50,7 +50,7 @@
#include <QtCore/qstringlist.h>
#endif
-#if defined(Q_WS_WIN) && !defined(tagMSG)
+#if defined(Q_OS_WIN) && !defined(tagMSG)
typedef struct tagMSG MSG;
#endif
@@ -84,16 +84,7 @@ public:
#endif
};
-#if defined(QT_BUILD_CORE_LIB) || defined(qdoc)
- QCoreApplication(int &argc, char **argv); // ### Qt5 remove
-#endif
-#if !defined(qdoc)
- QCoreApplication(int &argc, char **argv, int
-#if !defined(QT_BUILD_CORE_LIB)
- = ApplicationFlags
-#endif
- );
-#endif
+ QCoreApplication(int &argc, char **argv, int = ApplicationFlags);
~QCoreApplication();
@@ -177,7 +168,7 @@ public:
static QT3_SUPPORT int loopLevel();
#endif
-#if defined(Q_WS_WIN)
+#if defined(Q_OS_WIN)
virtual bool winEventFilter(MSG *message, long *result);
#endif
@@ -218,11 +209,15 @@ private:
friend class QEventDispatcherUNIXPrivate;
friend class QApplication;
friend class QApplicationPrivate;
+ friend class QGuiApplication;
+ friend class QGuiApplicationPrivate;
friend class QETWidget;
friend class Q3AccelManager;
friend class QShortcutMap;
friend class QWidget;
+ friend class QWidgetWindow;
friend class QWidgetPrivate;
+ friend class QEventDispatcherMacPrivate;
friend bool qt_sendSpontaneousEvent(QObject*, QEvent*);
friend Q_CORE_EXPORT QString qAppName();
friend class QClassFactory;
@@ -286,7 +281,7 @@ Q_CORE_EXPORT void qAddPostRoutine(QtCleanUpFunction);
Q_CORE_EXPORT void qRemovePostRoutine(QtCleanUpFunction);
Q_CORE_EXPORT QString qAppName(); // get application name
-#if defined(Q_WS_WIN) && !defined(QT_NO_DEBUG_STREAM)
+#if defined(Q_OS_WIN) && !defined(QT_NO_DEBUG_STREAM)
Q_CORE_EXPORT QString decodeMSG(const MSG &);
Q_CORE_EXPORT QDebug operator<<(QDebug, const MSG &);
#endif
diff --git a/src/corelib/kernel/qcoreapplication_p.h b/src/corelib/kernel/qcoreapplication_p.h
index 804906e6da..22585a1ce9 100644
--- a/src/corelib/kernel/qcoreapplication_p.h
+++ b/src/corelib/kernel/qcoreapplication_p.h
@@ -110,6 +110,7 @@ public:
int &argc;
char **argv;
void appendApplicationPathToLibraryPaths(void);
+ void cleanupThreadData();
#ifndef QT_NO_TRANSLATION
QTranslatorList translators;
@@ -120,6 +121,7 @@ public:
bool in_exec;
bool aboutToQuitEmitted;
+ bool threadData_clean;
QString cachedApplicationDirPath;
QString cachedApplicationFilePath;
#if defined(Q_OS_SYMBIAN)
diff --git a/src/corelib/kernel/qcoreapplication_win.cpp b/src/corelib/kernel/qcoreapplication_win.cpp
index 6a77a74861..cb6d39a481 100644
--- a/src/corelib/kernel/qcoreapplication_win.cpp
+++ b/src/corelib/kernel/qcoreapplication_win.cpp
@@ -240,7 +240,7 @@ void QCoreApplicationPrivate::removePostedTimerEvent(QObject *object, int timerI
}
}
-#if defined(Q_WS_WIN) && !defined(QT_NO_DEBUG_STREAM)
+#if defined(Q_OS_WIN) && !defined(QT_NO_DEBUG_STREAM)
/*****************************************************************************
Convenience functions for convert WM_* messages into human readable strings,
including a nifty QDebug operator<< for simpel QDebug() << msg output.
diff --git a/src/corelib/kernel/qcoreevent.h b/src/corelib/kernel/qcoreevent.h
index 98a08e9628..432f6a8cee 100644
--- a/src/corelib/kernel/qcoreevent.h
+++ b/src/corelib/kernel/qcoreevent.h
@@ -291,6 +291,11 @@ public:
ScrollPrepare = 204,
Scroll = 205,
+ Map = 206,
+ Unmap = 207,
+
+ Expose = 208,
+
// 512 reserved for Qt Jambi's MetaCall event
// 513 reserved for Qt Jambi's DeleteOnMainThread event
diff --git a/src/corelib/kernel/qeventdispatcher_win.cpp b/src/corelib/kernel/qeventdispatcher_win.cpp
index 84663fa5ea..fc66e9bfd6 100644
--- a/src/corelib/kernel/qeventdispatcher_win.cpp
+++ b/src/corelib/kernel/qeventdispatcher_win.cpp
@@ -50,7 +50,6 @@
#include "qvarlengtharray.h"
#include "qwineventnotifier_p.h"
-#include "qabstracteventdispatcher_p.h"
#include "qcoreapplication_p.h"
#include <private/qthread_p.h>
#include <private/qmutexpool_p.h>
@@ -280,33 +279,7 @@ int WSAAsyncSelect(SOCKET, HWND, unsigned int, long)
class QEventDispatcherWin32Private;
-struct QSockNot {
- QSocketNotifier *obj;
- int fd;
-};
-typedef QHash<int, QSockNot *> QSNDict;
-
-struct WinTimerInfo { // internal timer info
- QObject *dispatcher;
- int timerId;
- int interval;
- QObject *obj; // - object to receive events
- bool inTimerEvent;
- int fastTimerId;
-};
-
-class QZeroTimerEvent : public QTimerEvent
-{
-public:
- inline QZeroTimerEvent(int timerId)
- : QTimerEvent(timerId)
- { t = QEvent::ZeroTimerEvent; }
-};
-
-typedef QList<WinTimerInfo*> WinTimerVec; // vector of TimerInfo structs
-typedef QHash<int, WinTimerInfo*> WinTimerDict; // fast dict of timers
-
-#if !defined(DWORD_PTR) && !defined(Q_WS_WIN64)
+#if !defined(DWORD_PTR) && !defined(Q_OS_WIN64)
#define DWORD_PTR DWORD
#endif
@@ -338,47 +311,6 @@ static void resolveTimerAPI()
}
}
-
-class QEventDispatcherWin32Private : public QAbstractEventDispatcherPrivate
-{
- Q_DECLARE_PUBLIC(QEventDispatcherWin32)
-public:
- QEventDispatcherWin32Private();
- ~QEventDispatcherWin32Private();
-
- DWORD threadId;
-
- bool interrupt;
-
- // internal window handle used for socketnotifiers/timers/etc
- HWND internalHwnd;
- HHOOK getMessageHook;
-
- // for controlling when to send posted events
- QAtomicInt serialNumber;
- int lastSerialNumber, sendPostedEventsWindowsTimerId;
- QAtomicInt wakeUps;
-
- // timers
- WinTimerVec timerVec;
- WinTimerDict timerDict;
- void registerTimer(WinTimerInfo *t);
- void unregisterTimer(WinTimerInfo *t, bool closingDown = false);
- void sendTimerEvent(int timerId);
-
- // socket notifiers
- QSNDict sn_read;
- QSNDict sn_write;
- QSNDict sn_except;
- void doWsaAsyncSelect(int socket);
-
- QList<QWinEventNotifier *> winEventNotifierList;
- void activateEventNotifier(QWinEventNotifier * wen);
-
- QList<MSG> queuedUserInputEvents;
- QList<MSG> queuedSocketEvents;
-};
-
QEventDispatcherWin32Private::QEventDispatcherWin32Private()
: threadId(GetCurrentThreadId()), interrupt(false), internalHwnd(0), getMessageHook(0),
serialNumber(0), lastSerialNumber(0), sendPostedEventsWindowsTimerId(0), wakeUps(0)
@@ -703,6 +635,10 @@ QEventDispatcherWin32::QEventDispatcherWin32(QObject *parent)
{
}
+QEventDispatcherWin32::QEventDispatcherWin32(QEventDispatcherWin32Private &dd, QObject *parent)
+ : QAbstractEventDispatcher(dd, parent)
+{ }
+
QEventDispatcherWin32::~QEventDispatcherWin32()
{
}
diff --git a/src/corelib/kernel/qeventdispatcher_win_p.h b/src/corelib/kernel/qeventdispatcher_win_p.h
index 8fa77fdc4e..4a7aac0c04 100644
--- a/src/corelib/kernel/qeventdispatcher_win_p.h
+++ b/src/corelib/kernel/qeventdispatcher_win_p.h
@@ -56,6 +56,8 @@
#include "QtCore/qabstracteventdispatcher.h"
#include "QtCore/qt_windows.h"
+#include "qabstracteventdispatcher_p.h"
+
QT_BEGIN_NAMESPACE
class QWinEventNotifier;
@@ -100,11 +102,80 @@ public:
bool event(QEvent *e);
+protected:
+ QEventDispatcherWin32(QEventDispatcherWin32Private &dd, QObject *parent = 0);
+
private:
friend LRESULT QT_WIN_CALLBACK qt_internal_proc(HWND hwnd, UINT message, WPARAM wp, LPARAM lp);
friend LRESULT QT_WIN_CALLBACK qt_GetMessageHook(int, WPARAM, LPARAM);
};
+struct QSockNot {
+ QSocketNotifier *obj;
+ int fd;
+};
+typedef QHash<int, QSockNot *> QSNDict;
+
+struct WinTimerInfo { // internal timer info
+ QObject *dispatcher;
+ int timerId;
+ int interval;
+ QObject *obj; // - object to receive events
+ bool inTimerEvent;
+ int fastTimerId;
+};
+
+class QZeroTimerEvent : public QTimerEvent
+{
+public:
+ inline QZeroTimerEvent(int timerId)
+ : QTimerEvent(timerId)
+ { t = QEvent::ZeroTimerEvent; }
+};
+
+typedef QList<WinTimerInfo*> WinTimerVec; // vector of TimerInfo structs
+typedef QHash<int, WinTimerInfo*> WinTimerDict; // fast dict of timers
+
+class Q_CORE_EXPORT QEventDispatcherWin32Private : public QAbstractEventDispatcherPrivate
+{
+ Q_DECLARE_PUBLIC(QEventDispatcherWin32)
+public:
+ QEventDispatcherWin32Private();
+ ~QEventDispatcherWin32Private();
+
+ DWORD threadId;
+
+ bool interrupt;
+
+ // internal window handle used for socketnotifiers/timers/etc
+ HWND internalHwnd;
+ HHOOK getMessageHook;
+
+ // for controlling when to send posted events
+ QAtomicInt serialNumber;
+ int lastSerialNumber, sendPostedEventsWindowsTimerId;
+ QAtomicInt wakeUps;
+
+ // timers
+ WinTimerVec timerVec;
+ WinTimerDict timerDict;
+ void registerTimer(WinTimerInfo *t);
+ void unregisterTimer(WinTimerInfo *t, bool closingDown = false);
+ void sendTimerEvent(int timerId);
+
+ // socket notifiers
+ QSNDict sn_read;
+ QSNDict sn_write;
+ QSNDict sn_except;
+ void doWsaAsyncSelect(int socket);
+
+ QList<QWinEventNotifier *> winEventNotifierList;
+ void activateEventNotifier(QWinEventNotifier * wen);
+
+ QList<MSG> queuedUserInputEvents;
+ QList<MSG> queuedSocketEvents;
+};
+
QT_END_NAMESPACE
#endif // QEVENTDISPATCHER_WIN_P_H
diff --git a/src/corelib/kernel/qmetatype.cpp b/src/corelib/kernel/qmetatype.cpp
index fcc8a65a11..e5ef021ed1 100644
--- a/src/corelib/kernel/qmetatype.cpp
+++ b/src/corelib/kernel/qmetatype.cpp
@@ -265,19 +265,16 @@ static const struct { const char * typeName; int typeNameLength; int type; } typ
QT_ADD_STATIC_METATYPE("QEasingCurve", QMetaType::QEasingCurve),
/* All GUI types */
- QT_ADD_STATIC_METATYPE("QColorGroup", 63),
QT_ADD_STATIC_METATYPE("QFont", QMetaType::QFont),
QT_ADD_STATIC_METATYPE("QPixmap", QMetaType::QPixmap),
QT_ADD_STATIC_METATYPE("QBrush", QMetaType::QBrush),
QT_ADD_STATIC_METATYPE("QColor", QMetaType::QColor),
QT_ADD_STATIC_METATYPE("QPalette", QMetaType::QPalette),
- QT_ADD_STATIC_METATYPE("QIcon", QMetaType::QIcon),
QT_ADD_STATIC_METATYPE("QImage", QMetaType::QImage),
QT_ADD_STATIC_METATYPE("QPolygon", QMetaType::QPolygon),
QT_ADD_STATIC_METATYPE("QRegion", QMetaType::QRegion),
QT_ADD_STATIC_METATYPE("QBitmap", QMetaType::QBitmap),
QT_ADD_STATIC_METATYPE("QCursor", QMetaType::QCursor),
- QT_ADD_STATIC_METATYPE("QSizePolicy", QMetaType::QSizePolicy),
QT_ADD_STATIC_METATYPE("QKeySequence", QMetaType::QKeySequence),
QT_ADD_STATIC_METATYPE("QPen", QMetaType::QPen),
QT_ADD_STATIC_METATYPE("QTextLength", QMetaType::QTextLength),
@@ -290,6 +287,10 @@ static const struct { const char * typeName; int typeNameLength; int type; } typ
QT_ADD_STATIC_METATYPE("QVector4D", QMetaType::QVector4D),
QT_ADD_STATIC_METATYPE("QQuaternion", QMetaType::QQuaternion),
+ /* All Widgets types */
+ QT_ADD_STATIC_METATYPE("QIcon", QMetaType::QIcon),
+ QT_ADD_STATIC_METATYPE("QSizePolicy", QMetaType::QSizePolicy),
+
/* All Metatype builtins */
QT_ADD_STATIC_METATYPE("void*", QMetaType::VoidStar),
QT_ADD_STATIC_METATYPE("long", QMetaType::Long),
@@ -338,6 +339,7 @@ struct QMetaTypeGuiHelper
#endif
};
Q_CORE_EXPORT const QMetaTypeGuiHelper *qMetaTypeGuiHelper = 0;
+Q_CORE_EXPORT const QMetaTypeGuiHelper *qMetaTypeWidgetsHelper = 0;
class QCustomTypeInfo
{
@@ -399,14 +401,17 @@ void QMetaType::registerStreamOperators(int idx, SaveOperator saveOp,
*/
const char *QMetaType::typeName(int type)
{
- enum { GuiTypeCount = LastGuiType - FirstGuiType };
+ enum { GuiTypeCount = LastGuiType - FirstGuiType,
+ WidgetsTypeCount = LastWidgetsType - FirstWidgetsType };
if (type >= 0 && type <= LastCoreType) {
return types[type].typeName;
} else if (type >= FirstGuiType && type <= LastGuiType) {
return types[type - FirstGuiType + LastCoreType + 1].typeName;
+ } else if (type >= FirstWidgetsType && type <= LastWidgetsType) {
+ return types[type - FirstWidgetsType + GuiTypeCount + LastCoreType + 2].typeName;
} else if (type >= FirstCoreExtType && type <= LastCoreExtType) {
- return types[type - FirstCoreExtType + GuiTypeCount + LastCoreType + 2].typeName;
+ return types[type - FirstCoreExtType + GuiTypeCount + WidgetsTypeCount + LastCoreType + 3].typeName;
} else if (type >= User) {
const QVector<QCustomTypeInfo> * const ct = customTypes();
QReadLocker locker(customTypesLock());
@@ -768,13 +773,11 @@ bool QMetaType::save(QDataStream &stream, int type, const void *data)
case QMetaType::QBrush:
case QMetaType::QColor:
case QMetaType::QPalette:
- case QMetaType::QIcon:
case QMetaType::QImage:
case QMetaType::QPolygon:
case QMetaType::QRegion:
case QMetaType::QBitmap:
case QMetaType::QCursor:
- case QMetaType::QSizePolicy:
case QMetaType::QKeySequence:
case QMetaType::QPen:
case QMetaType::QTextLength:
@@ -790,6 +793,12 @@ bool QMetaType::save(QDataStream &stream, int type, const void *data)
return false;
qMetaTypeGuiHelper[type - FirstGuiType].saveOp(stream, data);
break;
+ case QMetaType::QIcon:
+ case QMetaType::QSizePolicy:
+ if (!qMetaTypeWidgetsHelper)
+ return false;
+ qMetaTypeWidgetsHelper[type - FirstWidgetsType].saveOp(stream, data);
+ break;
default: {
const QVector<QCustomTypeInfo> * const ct = customTypes();
if (!ct)
@@ -973,13 +982,11 @@ bool QMetaType::load(QDataStream &stream, int type, void *data)
case QMetaType::QBrush:
case QMetaType::QColor:
case QMetaType::QPalette:
- case QMetaType::QIcon:
case QMetaType::QImage:
case QMetaType::QPolygon:
case QMetaType::QRegion:
case QMetaType::QBitmap:
case QMetaType::QCursor:
- case QMetaType::QSizePolicy:
case QMetaType::QKeySequence:
case QMetaType::QPen:
case QMetaType::QTextLength:
@@ -995,6 +1002,12 @@ bool QMetaType::load(QDataStream &stream, int type, void *data)
return false;
qMetaTypeGuiHelper[type - FirstGuiType].loadOp(stream, data);
break;
+ case QMetaType::QIcon:
+ case QMetaType::QSizePolicy:
+ if (!qMetaTypeWidgetsHelper)
+ return false;
+ qMetaTypeWidgetsHelper[type - FirstWidgetsType].loadOp(stream, data);
+ break;
default: {
const QVector<QCustomTypeInfo> * const ct = customTypes();
if (!ct)
@@ -1224,6 +1237,10 @@ void *QMetaType::construct(int type, const void *copy)
if (!qMetaTypeGuiHelper)
return 0;
constr = qMetaTypeGuiHelper[type - FirstGuiType].constr;
+ } else if (type >= FirstWidgetsType && type <= LastWidgetsType) {
+ if (!qMetaTypeWidgetsHelper)
+ return 0;
+ constr = qMetaTypeWidgetsHelper[type - FirstWidgetsType].constr;
} else {
const QVector<QCustomTypeInfo> * const ct = customTypes();
QReadLocker locker(customTypesLock());
@@ -1386,6 +1403,12 @@ void QMetaType::destroy(int type, void *data)
if (!qMetaTypeGuiHelper)
return;
destr = qMetaTypeGuiHelper[type - FirstGuiType].destr;
+ } else if (type >= FirstWidgetsType && type <= LastWidgetsType) {
+ Q_ASSERT(qMetaTypeWidgetsHelper);
+
+ if (!qMetaTypeWidgetsHelper)
+ return;
+ destr = qMetaTypeWidgetsHelper[type - FirstWidgetsType].destr;
} else {
QReadLocker locker(customTypesLock());
if (type < User || !ct || ct->count() <= type - User)
diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h
index 36131d1815..da59a8fa2b 100644
--- a/src/corelib/kernel/qmetatype.h
+++ b/src/corelib/kernel/qmetatype.h
@@ -71,18 +71,19 @@ public:
QLine = 23, QLineF = 24, QPoint = 25, QPointF = 26, QRegExp = 27,
QVariantHash = 28, QEasingCurve = 29, LastCoreType = QEasingCurve,
- FirstGuiType = 63 /* QColorGroup */,
-#ifdef QT3_SUPPORT
- QColorGroup = 63,
-#endif
+ FirstGuiType = 64 /* QFont */,
QFont = 64, QPixmap = 65, QBrush = 66, QColor = 67, QPalette = 68,
- QIcon = 69, QImage = 70, QPolygon = 71, QRegion = 72, QBitmap = 73,
- QCursor = 74, QSizePolicy = 75, QKeySequence = 76, QPen = 77,
- QTextLength = 78, QTextFormat = 79, QMatrix = 80, QTransform = 81,
- QMatrix4x4 = 82, QVector2D = 83, QVector3D = 84, QVector4D = 85,
- QQuaternion = 86,
+ QImage = 69, QPolygon = 70, QRegion = 71, QBitmap = 72,
+ QCursor = 73, QKeySequence = 74, QPen = 75,
+ QTextLength = 76, QTextFormat = 77, QMatrix = 78, QTransform = 79,
+ QMatrix4x4 = 80, QVector2D = 81, QVector3D = 82, QVector4D = 83,
+ QQuaternion = 84,
LastGuiType = QQuaternion,
+ FirstWidgetsType = 120, /* QIcon */
+ QIcon = 120, QSizePolicy = 121,
+ LastWidgetsType = QSizePolicy,
+
FirstCoreExtType = 128 /* VoidStar */,
VoidStar = 128, Long = 129, Short = 130, Char = 131, ULong = 132,
UShort = 133, UChar = 134, Float = 135, QObjectStar = 136, QWidgetStar = 137,
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index b88643df5c..a958efd64f 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -157,6 +157,7 @@ QObjectPrivate::QObjectPrivate(int version)
#endif
metaObject = 0;
hasGuards = false;
+ isWindow = false;
}
QObjectPrivate::~QObjectPrivate()
diff --git a/src/corelib/kernel/qobject.h b/src/corelib/kernel/qobject.h
index 15d81b949a..0fa28c0e63 100644
--- a/src/corelib/kernel/qobject.h
+++ b/src/corelib/kernel/qobject.h
@@ -102,7 +102,8 @@ public:
uint inEventHandler : 1; //only used if QT_JAMBI_BUILD
uint inThreadChangeEvent : 1;
uint hasGuards : 1; //true iff there is one or more QPointer attached to this object
- uint unused : 22;
+ uint isWindow : 1; //for QWindow
+ uint unused : 21;
int postedEvents;
QMetaObject *metaObject; // assert dynamic
};
@@ -144,6 +145,7 @@ public:
void setObjectName(const QString &name);
inline bool isWidgetType() const { return d_ptr->isWidget; }
+ inline bool isWindowType() const { return d_ptr->isWindow; }
inline bool signalsBlocked() const { return d_ptr->blockSig; }
bool blockSignals(bool b);
diff --git a/src/corelib/kernel/qvariant.h b/src/corelib/kernel/qvariant.h
index 268d381848..6aa0fabc2c 100644
--- a/src/corelib/kernel/qvariant.h
+++ b/src/corelib/kernel/qvariant.h
@@ -127,40 +127,33 @@ class Q_CORE_EXPORT QVariant
LastCoreType = EasingCurve,
// value 62 is internally reserved
-#ifdef QT3_SUPPORT
- ColorGroup = 63,
-#endif
Font = 64,
Pixmap = 65,
Brush = 66,
Color = 67,
Palette = 68,
- Icon = 69,
- Image = 70,
- Polygon = 71,
- Region = 72,
- Bitmap = 73,
- Cursor = 74,
- SizePolicy = 75,
- KeySequence = 76,
- Pen = 77,
- TextLength = 78,
- TextFormat = 79,
- Matrix = 80,
- Transform = 81,
- Matrix4x4 = 82,
- Vector2D = 83,
- Vector3D = 84,
- Vector4D = 85,
- Quaternion = 86,
+ Image = 69,
+ Polygon = 70,
+ Region = 71,
+ Bitmap = 72,
+ Cursor = 73,
+ KeySequence = 74,
+ Pen = 75,
+ TextLength = 76,
+ TextFormat = 77,
+ Matrix = 78,
+ Transform = 79,
+ Matrix4x4 = 80,
+ Vector2D = 81,
+ Vector3D = 82,
+ Vector4D = 83,
+ Quaternion = 84,
LastGuiType = Quaternion,
+ Icon = 120,
+ SizePolicy = 121,
+
UserType = 127,
-#ifdef QT3_SUPPORT
- IconSet = Icon,
- CString = ByteArray,
- PointArray = Polygon,
-#endif
LastType = 0xffffffff // need this so that gcc >= 3.4 allocates 32 bits for Type
};
diff --git a/src/corelib/plugin/qlibrary_p.h b/src/corelib/plugin/qlibrary_p.h
index 44860f4b23..4f66bc26a0 100644
--- a/src/corelib/plugin/qlibrary_p.h
+++ b/src/corelib/plugin/qlibrary_p.h
@@ -53,7 +53,7 @@
// We mean it.
//
-#ifdef Q_WS_WIN
+#ifdef Q_OS_WIN
# include "QtCore/qt_windows.h"
#endif
#include "QtCore/qlibrary.h"
@@ -73,7 +73,7 @@ class QLibraryPrivate
{
public:
-#ifdef Q_WS_WIN
+#ifdef Q_OS_WIN
HINSTANCE
#else
void *
diff --git a/src/corelib/thread/qthread.cpp b/src/corelib/thread/qthread.cpp
index 02a63bb92d..aeb118ffe5 100644
--- a/src/corelib/thread/qthread.cpp
+++ b/src/corelib/thread/qthread.cpp
@@ -176,12 +176,12 @@ QThreadPrivate::QThreadPrivate(QThreadData *d)
{
#if defined (Q_OS_UNIX)
thread_id = 0;
-#elif defined (Q_WS_WIN)
+#elif defined (Q_OS_WIN)
handle = 0;
id = 0;
waiters = 0;
#endif
-#if defined (Q_WS_WIN) || defined (Q_OS_SYMBIAN)
+#if defined (Q_OS_WIN) || defined (Q_OS_SYMBIAN)
terminationEnabled = true;
terminatePending = false;
#endif
diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp
index 4303731e40..39141b7c00 100644
--- a/src/corelib/tools/qdatetime.cpp
+++ b/src/corelib/tools/qdatetime.cpp
@@ -51,7 +51,7 @@
#if defined(Q_OS_WIN32) || defined(Q_OS_WINCE)
#include <qt_windows.h>
#endif
-#ifndef Q_WS_WIN
+#ifndef Q_OS_WIN
#include <locale.h>
#endif
@@ -2519,7 +2519,7 @@ QString QDateTime::toString(Qt::DateFormat f) const
}
#ifndef QT_NO_TEXTDATE
else if (f == Qt::TextDate) {
-#ifndef Q_WS_WIN
+#ifndef Q_OS_WIN
buf = d->date.shortDayName(d->date.dayOfWeek());
buf += QLatin1Char(' ');
buf += d->date.shortMonthName(d->date.month());
diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp
index 4648ca155d..63ffae4e2b 100644
--- a/src/corelib/tools/qlocale.cpp
+++ b/src/corelib/tools/qlocale.cpp
@@ -39,6 +39,11 @@
**
****************************************************************************/
+#if !defined(QWS) && defined(Q_OS_MAC)
+# include "private/qcore_mac_p.h"
+# include <CoreFoundation/CoreFoundation.h>
+#endif
+
#include "qglobal.h"
#ifndef QT_NO_SYSTEMLOCALE
@@ -61,14 +66,10 @@ QT_END_NAMESPACE
#include "qstringlist.h"
#include "qvariant.h"
#include "qstringbuilder.h"
-#if defined(Q_WS_WIN)
+#if defined(Q_OS_WIN)
# include "qt_windows.h"
# include <time.h>
#endif
-#if !defined(QWS) && defined(Q_OS_MAC)
-# include "private/qcore_mac_p.h"
-# include <CoreFoundation/CoreFoundation.h>
-#endif
#include "private/qnumeric_p.h"
#include "private/qsystemlibrary_p.h"