diff options
author | Alexis Menard <alexis.menard@nokia.com> | 2009-04-17 12:01:04 (GMT) |
---|---|---|
committer | Alexis Menard <alexis.menard@nokia.com> | 2009-04-17 12:01:04 (GMT) |
commit | 198efeb27e5c2a87d0a2bb6859446cb1faf45ed8 (patch) | |
tree | e4c99e89cbecd2084a87a8c7a5d4877385fcec1c /src/corelib/kernel | |
parent | bb2e4df9bee3148e819c98410aa36e22dad95d7a (diff) | |
parent | e85867003ca1741f378b1f58f4dd9d48577a5d9b (diff) | |
download | Qt-198efeb27e5c2a87d0a2bb6859446cb1faf45ed8.zip Qt-198efeb27e5c2a87d0a2bb6859446cb1faf45ed8.tar.gz Qt-198efeb27e5c2a87d0a2bb6859446cb1faf45ed8.tar.bz2 |
Merge branch '4.5' of git@scm.dev.nokia.troll.no:qt/qt into kinetic-animations
Conflicts:
src/gui/graphicsview/qgraphicsitem.cpp
Diffstat (limited to 'src/corelib/kernel')
-rw-r--r-- | src/corelib/kernel/qcoreapplication.cpp | 8 | ||||
-rw-r--r-- | src/corelib/kernel/qcoreevent.h | 1 | ||||
-rw-r--r-- | src/corelib/kernel/qeventdispatcher_glib.cpp | 1 | ||||
-rw-r--r-- | src/corelib/kernel/qeventdispatcher_win.cpp | 15 | ||||
-rw-r--r-- | src/corelib/kernel/qmetaobject.cpp | 18 | ||||
-rw-r--r-- | src/corelib/kernel/qmetatype.cpp | 10 | ||||
-rw-r--r-- | src/corelib/kernel/qobject.cpp | 8 | ||||
-rw-r--r-- | src/corelib/kernel/qtranslator.cpp | 5 |
8 files changed, 47 insertions, 19 deletions
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index b3f9f1a..a23b2dd 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -377,6 +377,14 @@ QString qAppName() QLibrary) can be retrieved with libraryPaths() and manipulated by setLibraryPaths(), addLibraryPath(), and removeLibraryPath(). + On Unix/Linux Qt is configured to use the system local settings by + default. This can cause a conflict when using POSIX functions, for + instance, when converting between data types such as floats and + strings, since the notation may differ between locales. To get + around this problem call the POSIX function setlocale(LC_NUMERIC,"C") + right after initializing QApplication or QCoreApplication to reset + the locale that is used for number formatting to "C"-locale. + \sa QApplication, QAbstractEventDispatcher, QEventLoop, {Semaphores Example}, {Wait Conditions Example} */ diff --git a/src/corelib/kernel/qcoreevent.h b/src/corelib/kernel/qcoreevent.h index 1bddbe5..5e76976 100644 --- a/src/corelib/kernel/qcoreevent.h +++ b/src/corelib/kernel/qcoreevent.h @@ -267,6 +267,7 @@ public: GrabKeyboard = 188, UngrabKeyboard = 189, CocoaRequestModal = 190, // Internal for requesting an application modal Cocoa Window + MacGLClearDrawable = 191, // Internal Cocoa, the window has changed, so we must clear Signal = 191, StateFinished = 192, diff --git a/src/corelib/kernel/qeventdispatcher_glib.cpp b/src/corelib/kernel/qeventdispatcher_glib.cpp index 20548de..3fd768a 100644 --- a/src/corelib/kernel/qeventdispatcher_glib.cpp +++ b/src/corelib/kernel/qeventdispatcher_glib.cpp @@ -242,6 +242,7 @@ QEventDispatcherGlibPrivate::QEventDispatcherGlibPrivate(GMainContext *context) postEventSource = reinterpret_cast<GPostEventSource *>(g_source_new(&postEventSourceFuncs, sizeof(GPostEventSource))); + postEventSource->serialNumber = 1; g_source_set_can_recurse(&postEventSource->source, true); g_source_attach(&postEventSource->source, mainContext); diff --git a/src/corelib/kernel/qeventdispatcher_win.cpp b/src/corelib/kernel/qeventdispatcher_win.cpp index 880e95c..c4061f4 100644 --- a/src/corelib/kernel/qeventdispatcher_win.cpp +++ b/src/corelib/kernel/qeventdispatcher_win.cpp @@ -1059,11 +1059,20 @@ bool QEventDispatcherWin32::event(QEvent *e) QZeroTimerEvent *zte = static_cast<QZeroTimerEvent*>(e); WinTimerInfo *t = d->timerDict.value(zte->timerId()); if (t) { + t->inTimerEvent = true; + QTimerEvent te(zte->timerId()); QCoreApplication::sendEvent(t->obj, &te); - WinTimerInfo *tn = d->timerDict.value(zte->timerId()); - if (tn && t == tn) - QCoreApplication::postEvent(this, new QZeroTimerEvent(zte->timerId())); + + t = d->timerDict.value(zte->timerId()); + if (t) { + if (t->interval == 0 && t->inTimerEvent) { + // post the next zero timer event as long as the timer was not restarted + QCoreApplication::postEvent(this, new QZeroTimerEvent(zte->timerId())); + } + + t->inTimerEvent = false; + } } return true; } else if (e->type() == QEvent::Timer) { diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp index 719398c..b65f956 100644 --- a/src/corelib/kernel/qmetaobject.cpp +++ b/src/corelib/kernel/qmetaobject.cpp @@ -1007,6 +1007,11 @@ enum { MaximumParamCount = 11 }; // up to 10 arguments + 1 return value a QEvent will be sent and the member is invoked as soon as the application enters the main event loop. + \o If \a type is Qt::BlockingQueuedConnection, the method will be invoked in + the same way as for Qt::QueuedConnection, except that the current thread + will block until the event is delivered. Using this connection type to + communicate between objects in the same thread will lead to deadlocks. + \o If \a type is Qt::AutoConnection, the member is invoked synchronously if \a obj lives in the same thread as the caller; otherwise it will invoke the member asynchronously. @@ -1897,6 +1902,12 @@ static QByteArray qualifiedName(const QMetaEnum &e) \ingroup objectmodel + Property meta-data is obtained from an object's meta-object. See + QMetaObject::property() and QMetaObject::propertyCount() for + details. + + \section1 Property Meta-Data + A property has a name() and a type(), as well as various attributes that specify its behavior: isReadable(), isWritable(), isDesignable(), isScriptable(), and isStored(). @@ -1912,9 +1923,10 @@ static QByteArray qualifiedName(const QMetaEnum &e) functions. See QObject::setProperty() and QObject::property() for details. - You get property meta-data through an object's meta-object. See - QMetaObject::property() and QMetaObject::propertyCount() for - details. + \section1 Copying and Assignment + + QMetaProperty objects can be copied by value. However, each copy will + refer to the same underlying property meta-data. \sa QMetaObject, QMetaEnum, QMetaMethod, {Qt's Property System} */ diff --git a/src/corelib/kernel/qmetatype.cpp b/src/corelib/kernel/qmetatype.cpp index be60055..ce10bae 100644 --- a/src/corelib/kernel/qmetatype.cpp +++ b/src/corelib/kernel/qmetatype.cpp @@ -75,9 +75,9 @@ QT_BEGIN_NAMESPACE \relates QMetaType This macro makes the type \a Type known to QMetaType as long as it - provides a public default constructor, a public copy constructor, - and a public destructor. It is needed to use the type \a Type as a - custom type in QVariant. + provides a public default constructor, a public copy constructor and + a public destructor. + It is needed to use the type \a Type as a custom type in QVariant. Ideally, this macro should be placed below the declaration of the class or struct. If that is not possible, it can be put in @@ -1255,9 +1255,9 @@ void QMetaType::destroy(int type, void *data) \relates QMetaType \threadsafe - Registers the type name \a typeName to the type \c{T}. Returns + Registers the type name \a typeName for the type \c{T}. Returns the internal ID used by QMetaType. Any class or struct that has a - public constructor, a public copy constructor, and a public + public default constructor, a public copy constructor and a public destructor can be registered. After a type has been registered, you can create and destroy diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index 55cf464..05015c0 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -1121,13 +1121,13 @@ bool QObject::event(QEvent *e) QThreadData *threadData = d->threadData; QAbstractEventDispatcher *eventDispatcher = threadData->eventDispatcher; if (eventDispatcher) { - // set inThreadChangeEvent to true to tell the dispatcher not to release out timer ids - // back to the pool (since the timer ids are moving to a new thread). - d->inThreadChangeEvent = true; QList<QPair<int, int> > timers = eventDispatcher->registeredTimers(this); - d->inThreadChangeEvent = false; if (!timers.isEmpty()) { + // set inThreadChangeEvent to true to tell the dispatcher not to release out timer ids + // back to the pool (since the timer ids are moving to a new thread). + d->inThreadChangeEvent = true; eventDispatcher->unregisterTimers(this); + d->inThreadChangeEvent = false; QMetaObject::invokeMethod(this, "_q_reregisterTimers", Qt::QueuedConnection, Q_ARG(void*, (new QList<QPair<int, int> >(timers)))); } diff --git a/src/corelib/kernel/qtranslator.cpp b/src/corelib/kernel/qtranslator.cpp index cdddf36..77d6599 100644 --- a/src/corelib/kernel/qtranslator.cpp +++ b/src/corelib/kernel/qtranslator.cpp @@ -95,8 +95,7 @@ static bool match(const uchar* found, const char* target, uint len) // (normalize it to be without the zero-terminating symbol) if (len > 0 && found[len-1] == '\0') --len; - // 0 means anything, "" means empty - return !found || (qstrncmp((const char *)found, target, len) == 0 && target[len] == '\0'); + return (memcmp(found, target, len) == 0 && target[len] == '\0'); } static uint elfHash(const char *name) @@ -765,8 +764,6 @@ void QTranslatorPrivate::clear() } /*! - \since 4.5 - Returns the translation for the key (\a context, \a sourceText, \a disambiguation). If none is found, also tries (\a context, \a sourceText, ""). If that still fails, returns an empty string. |