diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-03-10 06:53:20 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-03-10 06:53:20 (GMT) |
commit | 12d63b05a942281e688d857d17c190564c77b698 (patch) | |
tree | a42f444e588074d484875bfbbaf186ff7934bf3b /src/corelib/kernel/qtimer.cpp | |
parent | 4e8b2039ecbbda87b5c23cc0a574b7accfc2ad33 (diff) | |
parent | cbda8ea64d8492d7c8f125cc1b43396b91ecdd8e (diff) | |
download | Qt-12d63b05a942281e688d857d17c190564c77b698.zip Qt-12d63b05a942281e688d857d17c190564c77b698.tar.gz Qt-12d63b05a942281e688d857d17c190564c77b698.tar.bz2 |
Merge branch '4.7-cutoff' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7-integration
* '4.7-cutoff' of scm.dev.nokia.troll.no:qt/oslo-staging-1: (83 commits)
Don't wait forever when scanning for wifi networks on win32 fails.
Revert 12b6987031be9faee3886d7623888feb4e1762af
Changed TEST_COMPILER from CC to CXX in configure script.
doc: Fixed several qdoc errors.
Carbon: Native filedialog does not apply filters on app-bundles
Cocoa: Native filedialog does not apply filters on app-bundles
Improve performance of QTimer::singleShot
Add a benchmark comparing single shot timer with invokeMethod
use Qt's private mac functions, reduce code redundancy
Assistant: Fix compile warning for empty header.
Doc: mark QEasingCurve support functions as new in 4.7.
Modify the XML test suite not to use non-characters.
Autotest: Fix failing QTextCodec tests
Doc: mark methods as internal (as they were in previous releases)
Doc: add image for Qt Quick to "What's New" page.
qdoc: Clear a static multimap after each qdocconf file.
qdoc: Added some debug output to track down a crash
Fixed mouse wheel handling in scrollareas.
Added two missing keys for X11
Carbon: usage of menu bars can cause exceptions to be thrown
...
Diffstat (limited to 'src/corelib/kernel/qtimer.cpp')
-rw-r--r-- | src/corelib/kernel/qtimer.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/corelib/kernel/qtimer.cpp b/src/corelib/kernel/qtimer.cpp index e17c995..7650f6a 100644 --- a/src/corelib/kernel/qtimer.cpp +++ b/src/corelib/kernel/qtimer.cpp @@ -339,8 +339,20 @@ QT_END_INCLUDE_NAMESPACE void QTimer::singleShot(int msec, QObject *receiver, const char *member) { - if (receiver && member) + if (receiver && member) { + if (msec == 0) { + // special code shortpath for 0-timers + const char* bracketPosition = strchr(member, '('); + if (!bracketPosition || !(member[0] >= '0' && member[0] <= '3')) { + qWarning("QTimer::singleShot: Invalid slot specification"); + return; + } + QByteArray methodName(member+1, bracketPosition - 1 - member); // extract method name + QMetaObject::invokeMethod(receiver, methodName.constData(), Qt::QueuedConnection); + return; + } (void) new QSingleShotTimer(msec, receiver, member); + } } /*! |