diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2009-10-26 17:53:45 (GMT) |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2009-10-26 17:53:45 (GMT) |
commit | 8f4160b70888218677e976a68e205f4ca8b7d740 (patch) | |
tree | 60d392c1f112b6807ddbfda7ff3a40bb6c5b75bf /src/corelib/global | |
parent | 9b0c0faf73dbdc382f1c02a42b10018bf9961d72 (diff) | |
parent | 83aa359398a8a510ac732410c918d31eedeeb4f8 (diff) | |
download | Qt-8f4160b70888218677e976a68e205f4ca8b7d740.zip Qt-8f4160b70888218677e976a68e205f4ca8b7d740.tar.gz Qt-8f4160b70888218677e976a68e205f4ca8b7d740.tar.bz2 |
Merge remote branch 'origin/4.6'
Conflicts:
tools/qdoc3/test/qt-build-docs.qdocconf
Diffstat (limited to 'src/corelib/global')
-rw-r--r-- | src/corelib/global/qglobal.cpp | 25 | ||||
-rw-r--r-- | src/corelib/global/qglobal.h | 2 | ||||
-rw-r--r-- | src/corelib/global/qnamespace.h | 5 | ||||
-rw-r--r-- | src/corelib/global/qnamespace.qdoc | 3 |
4 files changed, 28 insertions, 7 deletions
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index 5a7b559..7d47944 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -2479,7 +2479,7 @@ bool qputenv(const char *varName, const QByteArray& value) #endif } -#if defined(Q_OS_UNIX) && !defined(QT_NO_THREAD) && !defined(Q_OS_SYMBIAN) +#if (defined(Q_OS_UNIX) || defined(Q_OS_WIN)) && !defined(QT_NO_THREAD) && !defined(Q_OS_SYMBIAN) # if defined(Q_OS_INTEGRITY) && defined(__GHS_VERSION_NUMBER) && (__GHS_VERSION_NUMBER < 500) // older versions of INTEGRITY used a long instead of a uint for the seed. @@ -2535,20 +2535,35 @@ void qsrand(uint seed) */ void qsrand() { -#if defined(Q_OS_UNIX) && !defined(QT_NO_THREAD) && !defined(Q_OS_SYMBIAN) +#if (defined(Q_OS_UNIX) || defined(Q_OS_WIN)) && !defined(QT_NO_THREAD) && !defined(Q_OS_SYMBIAN) SeedStorageType *pseed = randTLS()->localData(); if (pseed) { // already seeded return; } randTLS()->setLocalData(pseed = new SeedStorageType); - static QBasicAtomicInt serial = Q_BASIC_ATOMIC_INITIALIZER(0); + // start beyond 1 to avoid the sequence reset + static QBasicAtomicInt serial = Q_BASIC_ATOMIC_INITIALIZER(2); *pseed = QDateTime::currentDateTime().toTime_t() + quintptr(&pseed) + serial.fetchAndAddRelaxed(1); -#else - // On Windows, we assume that rand() already does the right thing +#if defined(Q_OS_WIN) + // for Windows the srand function must still be called. + srand(*pseed); #endif + +#elif defined(Q_OS_WIN) + static unsigned int seed = 0; + + if (seed) + return; + + seed = GetTickCount(); + srand(seed); +#else + // Symbian? + +#endif // defined(Q_OS_UNIX) || defined(Q_OS_WIN)) && !defined(QT_NO_THREAD) && !defined(Q_OS_SYMBIAN) } /*! diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index b11cfb4..470b41e 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -466,7 +466,7 @@ namespace QT_NAMESPACE {} # define Q_NO_USING_KEYWORD # define QT_NO_STL_WCHAR # endif -# if __GNUC__ >= 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) +# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) # define Q_ALIGNOF(type) __alignof__(type) # define Q_TYPEOF(expr) __typeof__(expr) # define Q_DECL_ALIGN(n) __attribute__((__aligned__(n))) diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h index f28f94e..2b62c6b 100644 --- a/src/corelib/global/qnamespace.h +++ b/src/corelib/global/qnamespace.h @@ -1631,7 +1631,10 @@ public: enum GestureContext { WidgetGesture = 0, - WidgetWithChildrenGesture = 3 + WidgetWithChildrenGesture = 3, + + ItemGesture = WidgetGesture, + ItemWithChildrenGesture = WidgetWithChildrenGesture }; enum NavigationMode diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index e8d6df0..5f9d01d 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -2841,6 +2841,9 @@ \value WidgetGesture Gestures can only start over the widget itself. \value WidgetWithChildrenGesture Gestures can start on the widget or over any of its children. + \value ItemGesture Gestures can only start over the item itself. + \value ItemWithChildrenGesture Gestures can start on the item or over + any of its children. \sa QWidget::grabGesture() */ |