diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2014-03-31 16:49:14 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-04-02 14:04:11 +0200 |
commit | 4e012093462f07e7ffd42d4061539c54b4f43ace (patch) | |
tree | 5a90968cf1a57860af3a870d5a0d2c0619629bb6 /tests/auto | |
parent | 010e3e4f8d4045d3e807d612289886f3d709773c (diff) |
Avoid recompiling of signal handlers defined in QtQuick state changes and Connection objects
We can re-use the expression we've compiled at QML type compilation time, as
long as we "inject" the signal parameters in the dynamic qml lookup chain.
Change-Id: Icc417531c41dea06ff5d033011179af49b03f542
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/qml/qqmlconnections/tst_qqmlconnections.cpp | 5 | ||||
-rw-r--r-- | tests/auto/qml/qqmllanguage/testtypes.cpp | 4 | ||||
-rw-r--r-- | tests/auto/qml/qqmllanguage/testtypes.h | 8 |
3 files changed, 8 insertions, 9 deletions
diff --git a/tests/auto/qml/qqmlconnections/tst_qqmlconnections.cpp b/tests/auto/qml/qqmlconnections/tst_qqmlconnections.cpp index dbf48779d6..1cd1583f22 100644 --- a/tests/auto/qml/qqmlconnections/tst_qqmlconnections.cpp +++ b/tests/auto/qml/qqmlconnections/tst_qqmlconnections.cpp @@ -251,10 +251,9 @@ void tst_qqmlconnections::rewriteErrors() { QQmlEngine engine; QQmlComponent c(&engine, testFileUrl("rewriteError-unnamed.qml")); + QTest::ignoreMessage(QtWarningMsg, (c.url().toString() + ":5:35: QML Connections: Signal uses unnamed parameter followed by named parameter.").toLatin1()); TestObject *obj = qobject_cast<TestObject*>(c.create()); QVERIFY(obj != 0); - - QTest::ignoreMessage(QtWarningMsg, (c.url().toString() + ":5:35: QML Connections: Signal uses unnamed parameter followed by named parameter.").toLatin1()); obj->unnamedArgumentSignal(1, .5, "hello"); QCOMPARE(obj->ran(), false); @@ -264,10 +263,10 @@ void tst_qqmlconnections::rewriteErrors() { QQmlEngine engine; QQmlComponent c(&engine, testFileUrl("rewriteError-global.qml")); + QTest::ignoreMessage(QtWarningMsg, (c.url().toString() + ":5:35: QML Connections: Signal parameter \"parseInt\" hides global variable.").toLatin1()); TestObject *obj = qobject_cast<TestObject*>(c.create()); QVERIFY(obj != 0); - QTest::ignoreMessage(QtWarningMsg, (c.url().toString() + ":5:35: QML Connections: Signal parameter \"parseInt\" hides global variable.").toLatin1()); obj->signalWithGlobalName(10); QCOMPARE(obj->ran(), false); diff --git a/tests/auto/qml/qqmllanguage/testtypes.cpp b/tests/auto/qml/qqmllanguage/testtypes.cpp index 226206edfd..8ffa327cf2 100644 --- a/tests/auto/qml/qqmllanguage/testtypes.cpp +++ b/tests/auto/qml/qqmllanguage/testtypes.cpp @@ -125,7 +125,7 @@ QByteArray CustomBindingParser::compile(const QV4::CompiledData::QmlUnit *qmlUni return result; } -void CustomBindingParser::setCustomData(QObject *object, const QByteArray &data) +void CustomBindingParser::setCustomData(QObject *object, const QByteArray &data, QQmlCompiledData*) { CustomBinding *customBinding = qobject_cast<CustomBinding*>(object); Q_ASSERT(customBinding); @@ -197,7 +197,7 @@ QByteArray SimpleObjectCustomParser::compile(const QV4::CompiledData::QmlUnit *, return QByteArray::number(bindings.count()); } -void SimpleObjectCustomParser::setCustomData(QObject *object, const QByteArray &data) +void SimpleObjectCustomParser::setCustomData(QObject *object, const QByteArray &data, QQmlCompiledData*) { SimpleObjectWithCustomParser *o = qobject_cast<SimpleObjectWithCustomParser*>(object); Q_ASSERT(o); diff --git a/tests/auto/qml/qqmllanguage/testtypes.h b/tests/auto/qml/qqmllanguage/testtypes.h index 1f34309a5e..6a6b2eba45 100644 --- a/tests/auto/qml/qqmllanguage/testtypes.h +++ b/tests/auto/qml/qqmllanguage/testtypes.h @@ -729,14 +729,14 @@ class MyCustomParserTypeParser : public QQmlCustomParser { public: QByteArray compile(const QV4::CompiledData::QmlUnit *, const QList<const QV4::CompiledData::Binding *> &) { return QByteArray(); } - void setCustomData(QObject *, const QByteArray &) {} + void setCustomData(QObject *, const QByteArray &, QQmlCompiledData*) {} }; class EnumSupportingCustomParser : public QQmlCustomParser { public: QByteArray compile(const QV4::CompiledData::QmlUnit *qmlUnit, const QList<const QV4::CompiledData::Binding *> &bindings); - void setCustomData(QObject *, const QByteArray &) {} + void setCustomData(QObject *, const QByteArray &, QQmlCompiledData*) {} }; class MyParserStatus : public QObject, public QQmlParserStatus @@ -1107,7 +1107,7 @@ public: class CustomBindingParser : public QQmlCustomParser { virtual QByteArray compile(const QV4::CompiledData::QmlUnit *qmlUnit, const QList<const QV4::CompiledData::Binding *> &bindings); - virtual void setCustomData(QObject *object, const QByteArray &data); + virtual void setCustomData(QObject *object, const QByteArray &data, QQmlCompiledData *); }; class SimpleObjectWithCustomParser : public QObject @@ -1134,7 +1134,7 @@ private: class SimpleObjectCustomParser : public QQmlCustomParser { virtual QByteArray compile(const QV4::CompiledData::QmlUnit *, const QList<const QV4::CompiledData::Binding *> &bindings); - virtual void setCustomData(QObject *object, const QByteArray &data); + virtual void setCustomData(QObject *object, const QByteArray &data, QQmlCompiledData *); }; class RootObjectInCreationTester : public QObject |