diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-11-24 08:50:12 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-11-24 08:50:12 (GMT) |
commit | caca740ea1219227008c303b5f2fac24af5a62a0 (patch) | |
tree | fd5908b8e7accaca33697c98ccd7cb9a6ea84157 /src/declarative/qml | |
parent | 236e57bc9d85c4b05514dd3b792bf8e144320023 (diff) | |
parent | 5149da5a564c883209566f3baaeea15932eee1c2 (diff) | |
download | Qt-caca740ea1219227008c303b5f2fac24af5a62a0.zip Qt-caca740ea1219227008c303b5f2fac24af5a62a0.tar.gz Qt-caca740ea1219227008c303b5f2fac24af5a62a0.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-qml:
Fix incorrect example for Qt.rgba()
Flickable and MouseArea were too eager to take/keep mouse grab.
Allow javascript date and regexp objects in WorkerScript messages
Avoid lockup in ListView when animating delegates.
Fix asynchronous reload call in test, broken by previous submit
Update QtGui emulator def file for bug QT-3971
Ignore .pc/
Ensure WebView press delay timer is cancelled when grab is taken.
Prevent crash when calling reload() from within a .qml
Diffstat (limited to 'src/declarative/qml')
-rw-r--r-- | src/declarative/qml/qdeclarativeworkerscript.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/declarative/qml/qdeclarativeworkerscript.cpp b/src/declarative/qml/qdeclarativeworkerscript.cpp index be7ea0e..4b78020 100644 --- a/src/declarative/qml/qdeclarativeworkerscript.cpp +++ b/src/declarative/qml/qdeclarativeworkerscript.cpp @@ -52,6 +52,7 @@ #include <QtCore/qwaitcondition.h> #include <QtScript/qscriptvalueiterator.h> #include <QtCore/qfile.h> +#include <QtCore/qdatetime.h> #include <QtNetwork/qnetworkaccessmanager.h> #include <QtDeclarative/qdeclarativeinfo.h> #include "qdeclarativenetworkaccessmanagerfactory.h" @@ -314,6 +315,12 @@ QVariant QDeclarativeWorkerScriptEnginePrivate::scriptValueToVariant(const QScri return QVariant(value.toString()); } else if (value.isNumber()) { return QVariant((qreal)value.toNumber()); + } else if (value.isDate()) { + return QVariant(value.toDateTime()); +#ifndef QT_NO_REGEXP + } else if (value.isRegExp()) { + return QVariant(value.toRegExp()); +#endif } else if (value.isArray()) { QVariantList list; @@ -364,6 +371,12 @@ QScriptValue QDeclarativeWorkerScriptEnginePrivate::variantToScriptValue(const Q return QScriptValue(value.toString()); } else if (value.userType() == QMetaType::QReal) { return QScriptValue(value.toReal()); + } else if (value.userType() == QVariant::DateTime) { + return engine->newDate(value.toDateTime()); +#ifndef QT_NO_REGEXP + } else if (value.userType() == QVariant::RegExp) { + return engine->newRegExp(value.toRegExp()); +#endif } else if (value.userType() == qMetaTypeId<QDeclarativeListModelWorkerAgent::VariantRef>()) { QDeclarativeListModelWorkerAgent::VariantRef vr = qvariant_cast<QDeclarativeListModelWorkerAgent::VariantRef>(value); if (vr.a->scriptEngine() == 0) |