diff options
author | Fabian Kosmale <fabian.kosmale@qt.io> | 2020-10-27 16:54:01 +0100 |
---|---|---|
committer | Fabian Kosmale <fabian.kosmale@qt.io> | 2020-10-28 11:03:53 +0100 |
commit | 2425cd478138c52694aaa20b7f7eb4a91d97b51c (patch) | |
tree | 1206bfcd5b6f907476cbcc919e3aa121d10a42f8 /tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp | |
parent | 00a29d1c9a6e4d52efcf980250bf59d0138588a3 (diff) |
Inline components: Fix custom parser support
Fixes: QTBUG-85713
Fixes: QTBUG-87464
Pick-to: 5.15 5.15.2
Change-Id: I5c190ad2d02190de90260042cc06e51c1da01c63
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp')
-rw-r--r-- | tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp index feea81dd29..4e8e668c18 100644 --- a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp +++ b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp @@ -113,6 +113,7 @@ private slots: void bindJSValueToType(); void bindTypeToJSValue(); void customParserTypes(); + void customParserTypeInInlineComponent(); void rootAsQmlComponent(); void rootItemIsComponent(); void inlineQmlComponents(); @@ -1287,6 +1288,16 @@ void tst_qqmllanguage::customParserTypes() QCOMPARE(object->property("count"), QVariant(2)); } +// Tests that custom pursor types can be instantiated in ICs +void tst_qqmllanguage::customParserTypeInInlineComponent() +{ + QQmlComponent component(&engine, testFileUrl("customParserTypeInIC.qml")); + VERIFY_ERRORS(0); + QScopedPointer<QObject> object(component.create()); + QVERIFY(object != nullptr); + QCOMPARE(object->property("count"), 2); +} + // Tests that the root item can be a custom component void tst_qqmllanguage::rootAsQmlComponent() { |