diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2011-01-17 18:11:50 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-01-17 18:11:50 (GMT) |
commit | fd826d4a885fdbef00727b900a44b185343eb824 (patch) | |
tree | 15d078b5348709d449402d13e401db0eb70ae72b /src | |
parent | 90272f30899bafcf30aa649e44804fcd12bb7fbd (diff) | |
parent | 0f9cbfc6124b331d006b396d56ad5ae0e6d548e0 (diff) | |
download | Qt-fd826d4a885fdbef00727b900a44b185343eb824.zip Qt-fd826d4a885fdbef00727b900a44b185343eb824.tar.gz Qt-fd826d4a885fdbef00727b900a44b185343eb824.tar.bz2 |
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-earth-staging into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/qt-earth-staging:
qRound: do not do operation with double when qreal is float
Fix the warnings when QBasicTimer are member of the ObjectPrivate
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/global/qglobal.h | 4 | ||||
-rw-r--r-- | src/corelib/kernel/qobject.cpp | 22 |
2 files changed, 13 insertions, 13 deletions
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 945e45c..2a41b9e 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -1123,14 +1123,14 @@ template <typename T> inline T qAbs(const T &t) { return t >= 0 ? t : -t; } inline int qRound(qreal d) -{ return d >= 0.0 ? int(d + 0.5) : int(d - int(d-1) + 0.5) + int(d-1); } +{ return d >= qreal(0.0) ? int(d + qreal(0.5)) : int(d - int(d-1) + qreal(0.5)) + int(d-1); } #if defined(QT_NO_FPU) || defined(QT_ARCH_ARM) || defined(QT_ARCH_WINDOWSCE) || defined(QT_ARCH_SYMBIAN) inline qint64 qRound64(double d) { return d >= 0.0 ? qint64(d + 0.5) : qint64(d - qreal(qint64(d-1)) + 0.5) + qint64(d-1); } #else inline qint64 qRound64(qreal d) -{ return d >= 0.0 ? qint64(d + 0.5) : qint64(d - qreal(qint64(d-1)) + 0.5) + qint64(d-1); } +{ return d >= qreal(0.0) ? qint64(d + qreal(0.5)) : qint64(d - qreal(qint64(d-1)) + qreal(0.5)) + qint64(d-1); } #endif template <typename T> diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index 2e9d003..c6153cb 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -161,6 +161,17 @@ QObjectPrivate::QObjectPrivate(int version) QObjectPrivate::~QObjectPrivate() { + if (pendTimer) { + // unregister pending timers + if (threadData->eventDispatcher) + threadData->eventDispatcher->unregisterTimers(q_ptr); + } + + if (postedEvents) + QCoreApplication::removePostedEvents(q_ptr, 0); + + threadData->deref(); + delete static_cast<QAbstractDynamicMetaObject*>(metaObject); #ifdef QT_JAMBI_BUILD if (deleteWatch) @@ -911,25 +922,14 @@ QObject::~QObject() } } - if (d->pendTimer) { - // unregister pending timers - if (d->threadData->eventDispatcher) - d->threadData->eventDispatcher->unregisterTimers(this); - } - if (!d->children.isEmpty()) d->deleteChildren(); qt_removeObject(this); - if (d->postedEvents) - QCoreApplication::removePostedEvents(this, 0); - if (d->parent) // remove it from parent object d->setParent_helper(0); - d->threadData->deref(); - #ifdef QT_JAMBI_BUILD if (d->inEventHandler) { qWarning("QObject: Do not delete object, '%s', during its event handler!", |