summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/global/qglobal.h60
-rw-r--r--src/corelib/global/qnamespace.h21
-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.cpp1
-rw-r--r--src/corelib/kernel/qcoreevent.h8
-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.h16
-rw-r--r--src/corelib/kernel/qobject.cpp1
-rw-r--r--src/corelib/kernel/qobject.h4
-rw-r--r--src/corelib/kernel/qvariant.h37
-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
23 files changed, 236 insertions, 194 deletions
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index 56022a7e6e..94e0197a4a 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -289,7 +289,7 @@ namespace QT_NAMESPACE {}
#endif
#if defined(Q_OS_DARWIN)
-# define Q_OS_MAC /* Q_OS_MAC is mostly for compatibility, but also more clear */
+# define Q_OS_MAC
# define Q_OS_MACX /* Q_OS_MACX is only for compatibility.*/
# if defined(Q_OS_DARWIN64)
# define Q_OS_MAC64
@@ -298,15 +298,6 @@ namespace QT_NAMESPACE {}
# endif
#endif
-#ifdef QT_AUTODETECT_COCOA
-# ifdef Q_OS_MAC64
-# define QT_MAC_USE_COCOA 1
-# define QT_BUILD_KEY QT_BUILD_KEY_COCOA
-# else
-# define QT_BUILD_KEY QT_BUILD_KEY_CARBON
-# endif
-#endif
-
#if defined(Q_WS_MAC64) && !defined(QT_MAC_USE_COCOA) && !defined(QT_BUILD_QMAKE) && !defined(QT_BOOTSTRAPPED)
#error "You are building a 64-bit application, but using a 32-bit version of Qt. Check your build configuration."
#endif
@@ -880,7 +871,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_)
@@ -900,15 +893,7 @@ namespace QT_NAMESPACE {}
# define Q_WS_PM
# error "Qt does not work with OS/2 Presentation Manager or Workplace Shell"
#elif defined(Q_OS_UNIX)
-# if defined(Q_OS_MAC) && !defined(__USE_WS_X11__) && !defined(Q_WS_QWS) && !defined(Q_WS_QPA)
-# define Q_WS_MAC
-# define Q_WS_MACX
-# if defined(Q_OS_MAC64)
-# define Q_WS_MAC64
-# elif defined(Q_OS_MAC32)
-# define Q_WS_MAC32
-# endif
-# elif defined(Q_OS_SYMBIAN)
+# if defined(Q_OS_SYMBIAN)
# if !defined(QT_NO_S60)
# define Q_WS_S60
# endif
@@ -1146,7 +1131,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
@@ -1275,6 +1260,16 @@ 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_PRINTSUPPORT_LIB)
+# define Q_PRINTSUPPORT_EXPORT Q_DECL_EXPORT
+# else
+# define Q_PRINTSUPPORT_EXPORT Q_DECL_IMPORT
+# endif
# if defined(QT_BUILD_SQL_LIB)
# define Q_SQL_EXPORT Q_DECL_EXPORT
# else
@@ -1359,6 +1354,8 @@ 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_PRINTSUPPORT_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
@@ -1391,6 +1388,8 @@ 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_PRINTSUPPORT_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
@@ -1409,6 +1408,8 @@ class QDataStream;
# else
# define Q_CORE_EXPORT
# define Q_GUI_EXPORT
+# define Q_WIDGETS_EXPORT
+# define Q_PRINTSUPPORT_EXPORT
# define Q_SQL_EXPORT
# define Q_NETWORK_EXPORT
# define Q_SVG_EXPORT
@@ -1439,6 +1440,16 @@ 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_PRINTSUPPORT_LIB)
+# define Q_PRINTSUPPORT_EXPORT_INLINE Q_PRINTSUPPORT_EXPORT inline
+# else
+# define Q_PRINTSUPPORT_EXPORT_INLINE inline
+# endif
# if defined(QT_BUILD_COMPAT_LIB)
# define Q_COMPAT_EXPORT_INLINE Q_COMPAT_EXPORT inline
# else
@@ -1450,10 +1461,14 @@ 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_PRINTSUPPORT_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_PRINTSUPPORT_EXPORT_INLINE Q_PRINTSUPPORT_EXPORT inline
# define Q_COMPAT_EXPORT_INLINE Q_COMPAT_EXPORT inline
#endif
@@ -1537,7 +1552,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,
@@ -2023,6 +2038,7 @@ static inline bool qIsNull(float f)
return false; \
}
#else
+
# define Q_DUMMY_COMPARISON_OPERATOR(C)
#endif
diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h
index 9253b19e60..2fc82c55ca 100644
--- a/src/corelib/global/qnamespace.h
+++ b/src/corelib/global/qnamespace.h
@@ -237,13 +237,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,
@@ -258,13 +258,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,
@@ -1246,7 +1240,8 @@ public:
ImSurroundingText,
ImCurrentSelection,
ImMaximumTextLength,
- ImAnchorPosition
+ ImAnchorPosition,
+ ImHints
};
enum InputMethodHint {
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 49d8a7b4f7..3621deea28 100644
--- a/src/corelib/io/qdir.cpp
+++ b/src/corelib/io/qdir.cpp
@@ -1730,7 +1730,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 af43ab7320..ddbbbd5286 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 2458f9649e..d12391914b 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
@@ -331,7 +331,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;
static const char *const empty = "";
@@ -356,7 +356,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);
@@ -375,6 +380,7 @@ QCoreApplicationPrivate::~QCoreApplicationPrivate()
threadData->postEventList.clear();
threadData->postEventList.recursion = 0;
threadData->quitNow = false;
+ threadData_clean = true;
}
}
@@ -590,23 +596,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))
{
@@ -1286,7 +1275,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);
@@ -1977,7 +1966,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)
@@ -2172,7 +2161,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 adc70387cc..04d538d1b3 100644
--- a/src/corelib/kernel/qcoreapplication.h
+++ b/src/corelib/kernel/qcoreapplication.h
@@ -46,7 +46,7 @@
#include <QtCore/qcoreevent.h>
#include <QtCore/qeventloop.h>
-#if defined(Q_WS_WIN) && !defined(tagMSG)
+#if defined(Q_OS_WIN) && !defined(tagMSG)
typedef struct tagMSG MSG;
#endif
@@ -77,16 +77,7 @@ public:
enum { ApplicationFlags = QT_VERSION
};
-#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();
@@ -157,7 +148,7 @@ public:
static void flush();
-#if defined(Q_WS_WIN)
+#if defined(Q_OS_WIN)
virtual bool winEventFilter(MSG *message, long *result);
#endif
@@ -198,11 +189,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 QCocoaEventDispatcherPrivate;
friend bool qt_sendSpontaneousEvent(QObject*, QEvent*);
friend Q_CORE_EXPORT QString qAppName();
friend class QClassFactory;
@@ -266,7 +261,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 553e15f7db..62026141a1 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.cpp b/src/corelib/kernel/qcoreevent.cpp
index 20376b9fa4..213f0e4a58 100644
--- a/src/corelib/kernel/qcoreevent.cpp
+++ b/src/corelib/kernel/qcoreevent.cpp
@@ -126,6 +126,7 @@ QT_BEGIN_NAMESPACE
\value Enter Mouse enters widget's boundaries.
\value EnterEditFocus An editor widget gains focus for editing.
\value EnterWhatsThisMode Send to toplevel widgets when the application enters "What's This?" mode.
+ \value Expose Sent to a window when its on-screen contents are invalidated and need to be flushed from the backing store.
\value FileOpen File open request (QFileOpenEvent).
\value FocusIn Widget gains keyboard focus (QFocusEvent).
\value FocusOut Widget loses keyboard focus (QFocusEvent).
diff --git a/src/corelib/kernel/qcoreevent.h b/src/corelib/kernel/qcoreevent.h
index 01a5356f73..831a403975 100644
--- a/src/corelib/kernel/qcoreevent.h
+++ b/src/corelib/kernel/qcoreevent.h
@@ -273,7 +273,13 @@ public:
ScrollPrepare = 204,
Scroll = 205,
- OrientationChange = 206, // Screen orientation has changed
+ Map = 206,
+ Unmap = 207,
+
+ Expose = 208,
+
+ InputMethodQuery = 209,
+ OrientationChange = 210, // Screen orientation has changed
// 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 f241903cb9..c97f9d260e 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());
@@ -765,13 +770,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:
@@ -787,6 +790,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)
@@ -967,13 +976,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:
@@ -989,6 +996,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)
@@ -1218,6 +1231,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());
@@ -1380,6 +1397,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 767d79a14e..5df7658a13 100644
--- a/src/corelib/kernel/qmetatype.h
+++ b/src/corelib/kernel/qmetatype.h
@@ -71,16 +71,20 @@ public:
QLine = 23, QLineF = 24, QPoint = 25, QPointF = 26, QRegExp = 27,
QVariantHash = 28, QEasingCurve = 29, LastCoreType = QEasingCurve,
- FirstGuiType = 63 /* QColorGroup */,
+ 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 dce78393d0..2d280f14f7 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -176,6 +176,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 59ff988ba9..591c5c88bf 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 de8f9111f9..e77fc90b92 100644
--- a/src/corelib/kernel/qvariant.h
+++ b/src/corelib/kernel/qvariant.h
@@ -132,26 +132,27 @@ class Q_CORE_EXPORT QVariant
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,
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 12d625050f..c6804955d9 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 ac5d6c4a8e..3d3bc55d71 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"