From 76282f480e0db0b308429324ebcab7f3abd1189e Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Tue, 27 Aug 2019 11:39:00 +0200 Subject: Use qmlRegisterAnonymousType in examples and tests Change-Id: I511d18ad8f73ea77a208e4448a8f86e5be5facc3 Reviewed-by: Fabian Kosmale Reviewed-by: Simon Hausmann --- examples/qml/referenceexamples/attached/main.cpp | 6 +++--- examples/qml/referenceexamples/binding/main.cpp | 6 +++--- examples/qml/referenceexamples/coercion/main.cpp | 2 +- examples/qml/referenceexamples/default/main.cpp | 2 +- examples/qml/referenceexamples/grouped/main.cpp | 4 ++-- examples/qml/referenceexamples/signal/main.cpp | 6 +++--- examples/qml/referenceexamples/valuesource/main.cpp | 6 +++--- tests/auto/qml/qqmllanguage/testtypes.cpp | 2 +- tests/auto/qml/qqmllistreference/tst_qqmllistreference.cpp | 2 +- tests/auto/quick/qquicklistview/tst_qquicklistview.cpp | 2 +- 10 files changed, 19 insertions(+), 19 deletions(-) diff --git a/examples/qml/referenceexamples/attached/main.cpp b/examples/qml/referenceexamples/attached/main.cpp index 581b033dfc..444acfdee7 100644 --- a/examples/qml/referenceexamples/attached/main.cpp +++ b/examples/qml/referenceexamples/attached/main.cpp @@ -58,10 +58,10 @@ int main(int argc, char ** argv) { QCoreApplication app(argc, argv); - qmlRegisterType(); + qmlRegisterAnonymousType("People", 1); qmlRegisterType("People", 1,0, "BirthdayParty"); - qmlRegisterType(); - qmlRegisterType(); + qmlRegisterAnonymousType("People", 1); + qmlRegisterAnonymousType("People", 1); qmlRegisterType("People", 1,0, "Boy"); qmlRegisterType("People", 1,0, "Girl"); diff --git a/examples/qml/referenceexamples/binding/main.cpp b/examples/qml/referenceexamples/binding/main.cpp index 99187eba3e..18a424ff38 100644 --- a/examples/qml/referenceexamples/binding/main.cpp +++ b/examples/qml/referenceexamples/binding/main.cpp @@ -58,11 +58,11 @@ int main(int argc, char ** argv) { QCoreApplication app(argc, argv); - qmlRegisterType(); + qmlRegisterAnonymousType("People", 1); qmlRegisterType("People", 1,0, "BirthdayParty"); qmlRegisterType("People", 1,0, "HappyBirthdaySong"); - qmlRegisterType(); - qmlRegisterType(); + qmlRegisterAnonymousType("People", 1); + qmlRegisterAnonymousType("People", 1); qmlRegisterType("People", 1,0, "Boy"); qmlRegisterType("People", 1,0, "Girl"); diff --git a/examples/qml/referenceexamples/coercion/main.cpp b/examples/qml/referenceexamples/coercion/main.cpp index 262cdf6320..b7d211b73a 100644 --- a/examples/qml/referenceexamples/coercion/main.cpp +++ b/examples/qml/referenceexamples/coercion/main.cpp @@ -60,7 +60,7 @@ int main(int argc, char ** argv) qmlRegisterType("People", 1,0, "BirthdayParty"); //![0] - qmlRegisterType(); + qmlRegisterAnonymousType("People", 1); //![0] //![register boy girl] diff --git a/examples/qml/referenceexamples/default/main.cpp b/examples/qml/referenceexamples/default/main.cpp index 017d6495cd..c63a3a5788 100644 --- a/examples/qml/referenceexamples/default/main.cpp +++ b/examples/qml/referenceexamples/default/main.cpp @@ -59,7 +59,7 @@ int main(int argc, char ** argv) QCoreApplication app(argc, argv); qmlRegisterType("People", 1,0, "BirthdayParty"); - qmlRegisterType(); + qmlRegisterAnonymousType("People", 1); qmlRegisterType("People", 1,0, "Boy"); qmlRegisterType("People", 1,0, "Girl"); diff --git a/examples/qml/referenceexamples/grouped/main.cpp b/examples/qml/referenceexamples/grouped/main.cpp index 14cd64fe68..a237006e29 100644 --- a/examples/qml/referenceexamples/grouped/main.cpp +++ b/examples/qml/referenceexamples/grouped/main.cpp @@ -59,8 +59,8 @@ int main(int argc, char ** argv) QCoreApplication app(argc, argv); qmlRegisterType("People", 1,0, "BirthdayParty"); - qmlRegisterType(); - qmlRegisterType(); + qmlRegisterAnonymousType("People", 1); + qmlRegisterAnonymousType("People", 1); qmlRegisterType("People", 1,0, "Boy"); qmlRegisterType("People", 1,0, "Girl"); diff --git a/examples/qml/referenceexamples/signal/main.cpp b/examples/qml/referenceexamples/signal/main.cpp index bb75e02bc2..c62dd8ffc0 100644 --- a/examples/qml/referenceexamples/signal/main.cpp +++ b/examples/qml/referenceexamples/signal/main.cpp @@ -58,10 +58,10 @@ int main(int argc, char ** argv) { QCoreApplication app(argc, argv); - qmlRegisterType(); + qmlRegisterAnonymousType("People", 1); qmlRegisterType("People", 1,0, "BirthdayParty"); - qmlRegisterType(); - qmlRegisterType(); + qmlRegisterAnonymousType("People", 1); + qmlRegisterAnonymousType("People", 1); qmlRegisterType("People", 1,0, "Boy"); qmlRegisterType("People", 1,0, "Girl"); diff --git a/examples/qml/referenceexamples/valuesource/main.cpp b/examples/qml/referenceexamples/valuesource/main.cpp index 4bef695fe2..246954005a 100644 --- a/examples/qml/referenceexamples/valuesource/main.cpp +++ b/examples/qml/referenceexamples/valuesource/main.cpp @@ -59,11 +59,11 @@ int main(int argc, char ** argv) { QCoreApplication app(argc, argv); - qmlRegisterType(); + qmlRegisterAnonymousType("People", 1); qmlRegisterType("People", 1,0, "BirthdayParty"); qmlRegisterType("People", 1,0, "HappyBirthdaySong"); - qmlRegisterType(); - qmlRegisterType(); + qmlRegisterAnonymousType("People", 1); + qmlRegisterAnonymousType("People", 1); qmlRegisterType("People", 1,0, "Boy"); qmlRegisterType("People", 1,0, "Girl"); diff --git a/tests/auto/qml/qqmllanguage/testtypes.cpp b/tests/auto/qml/qqmllanguage/testtypes.cpp index ffb1d51971..05c1bd0116 100644 --- a/tests/auto/qml/qqmllanguage/testtypes.cpp +++ b/tests/auto/qml/qqmllanguage/testtypes.cpp @@ -57,7 +57,7 @@ void registerTypes() qmlRegisterType("Test",1,0,"MySecondNamespacedType"); qmlRegisterUncreatableMetaObject(MyNamespace::staticMetaObject, "Test", 1, 0, "MyNamespace", "Access to enums & flags only"); qmlRegisterType("Test",1,0,"MyParserStatus"); - qmlRegisterType(); + qmlRegisterAnonymousType("Test", 1); qmlRegisterType("Test",1,0,"MyRevisionedClass"); qmlRegisterType("Test",1,1,"MyRevisionedClass"); qmlRegisterType("Test",1,0,"MyRevisionedIllegalOverload"); diff --git a/tests/auto/qml/qqmllistreference/tst_qqmllistreference.cpp b/tests/auto/qml/qqmllistreference/tst_qqmllistreference.cpp index 199f7bc7e4..8efaedf5b5 100644 --- a/tests/auto/qml/qqmllistreference/tst_qqmllistreference.cpp +++ b/tests/auto/qml/qqmllistreference/tst_qqmllistreference.cpp @@ -87,7 +87,7 @@ public: void tst_qqmllistreference::initTestCase() { QQmlDataTest::initTestCase(); - qmlRegisterType(); + qmlRegisterAnonymousType("Test", 1); } void tst_qqmllistreference::qmllistreference() diff --git a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp index 08149a1786..7c26c22217 100644 --- a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp +++ b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp @@ -389,7 +389,7 @@ void tst_QQuickListView::init() m_view = nullptr; } #endif - qmlRegisterType(); + qmlRegisterAnonymousType("Proxy", 1); qmlRegisterType("Proxy", 1, 0, "ProxyTestInnerModel"); qmlRegisterType("Proxy", 1, 0, "QSortFilterProxyModel"); } -- cgit v1.2.3