summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/kernel')
-rw-r--r--src/corelib/kernel/qmetatype.cpp2
-rw-r--r--src/corelib/kernel/qtimer.cpp14
-rw-r--r--src/corelib/kernel/qvariant.cpp2
3 files changed, 17 insertions, 1 deletions
diff --git a/src/corelib/kernel/qmetatype.cpp b/src/corelib/kernel/qmetatype.cpp
index 8f2d025..30af6fa 100644
--- a/src/corelib/kernel/qmetatype.cpp
+++ b/src/corelib/kernel/qmetatype.cpp
@@ -590,6 +590,8 @@ bool QMetaType::isRegistered(int type)
int QMetaType::type(const char *typeName)
{
int length = qstrlen(typeName);
+ if (!length)
+ return 0;
int type = qMetaTypeStaticType(typeName, length);
if (!type) {
QReadLocker locker(customTypesLock());
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);
+ }
}
/*!
diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp
index 07c9e53..f5d7c0d 100644
--- a/src/corelib/kernel/qvariant.cpp
+++ b/src/corelib/kernel/qvariant.cpp
@@ -1511,6 +1511,7 @@ QVariant::QVariant(const char *val)
*/
/*!
+ \since 4.7
\fn QVariant::QVariant(const QEasingCurve &val)
Constructs a new variant with an easing curve value, \a val.
@@ -2204,6 +2205,7 @@ QDateTime QVariant::toDateTime() const
}
/*!
+ \since 4.7
\fn QEasingCurve QVariant::toEasingCurve() const
Returns the variant as a QEasingCurve if the variant has type() \l