summaryrefslogtreecommitdiff
path: root/tests/auto/qml
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2012-05-16 17:49:32 +1000
committerQt by Nokia <qt-info@nokia.com>2012-05-17 13:42:27 +0200
commit8017cf63505f7ed477c658634ec882a12d3b3ddc (patch)
tree28d023fe7e8a2b2392c564a37ef7b891d2bb41b8 /tests/auto/qml
parentc556eecc25e24d6ee4f5c9965193a588c93b95fc (diff)
downloadqtdeclarative-8017cf63505f7ed477c658634ec882a12d3b3ddc.tar.gz
Optimize type resolution
Faster qmlType() and resolveType() lookup. Change-Id: I096439f23bf6071e8bfdf0cda366cc71e00293ba Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
Diffstat (limited to 'tests/auto/qml')
-rw-r--r--tests/auto/qml/qqmlmetatype/qqmlmetatype.pro2
-rw-r--r--tests/auto/qml/qqmlmetatype/tst_qqmlmetatype.cpp15
2 files changed, 16 insertions, 1 deletions
diff --git a/tests/auto/qml/qqmlmetatype/qqmlmetatype.pro b/tests/auto/qml/qqmlmetatype/qqmlmetatype.pro
index d723907024..5e4567225b 100644
--- a/tests/auto/qml/qqmlmetatype/qqmlmetatype.pro
+++ b/tests/auto/qml/qqmlmetatype/qqmlmetatype.pro
@@ -4,4 +4,4 @@ SOURCES += tst_qqmlmetatype.cpp
macx:CONFIG -= app_bundle
CONFIG += parallel_test
-QT += core-private gui-private qml-private testlib
+QT += core-private gui-private qml-private testlib v8-private
diff --git a/tests/auto/qml/qqmlmetatype/tst_qqmlmetatype.cpp b/tests/auto/qml/qqmlmetatype/tst_qqmlmetatype.cpp
index 6e577ec095..a3f311e248 100644
--- a/tests/auto/qml/qqmlmetatype/tst_qqmlmetatype.cpp
+++ b/tests/auto/qml/qqmlmetatype/tst_qqmlmetatype.cpp
@@ -44,6 +44,7 @@
#include <private/qqmlmetatype_p.h>
#include <private/qqmlpropertyvalueinterceptor_p.h>
+#include <private/qhashedstring_p.h>
class tst_qqmlmetatype : public QObject
{
@@ -57,6 +58,7 @@ private slots:
void qmlParserStatusCast();
void qmlPropertyValueSourceCast();
void qmlPropertyValueInterceptorCast();
+ void qmlType();
void isList();
@@ -171,6 +173,19 @@ void tst_qqmlmetatype::qmlPropertyValueInterceptorCast()
QCOMPARE(interceptor, (QQmlPropertyValueInterceptor*)&t);
}
+void tst_qqmlmetatype::qmlType()
+{
+ QQmlType *type = QQmlMetaType::qmlType(QString("ParserStatusTestType"), QString("Test"), 1, 0);
+ QVERIFY(type);
+ QVERIFY(type->module() == QLatin1String("Test"));
+ QVERIFY(type->elementName() == QLatin1String("ParserStatusTestType"));
+
+ type = QQmlMetaType::qmlType("Test/ParserStatusTestType", 1, 0);
+ QVERIFY(type);
+ QVERIFY(type->module() == QLatin1String("Test"));
+ QVERIFY(type->elementName() == QLatin1String("ParserStatusTestType"));
+}
+
void tst_qqmlmetatype::isList()
{
QCOMPARE(QQmlMetaType::isList(QVariant::Invalid), false);