diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2018-03-05 10:19:33 +0100 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@qt.io> | 2018-03-08 07:07:49 +0000 |
commit | efa0dac9c4c456793f9e0e706a3b026ed0941801 (patch) | |
tree | 61a63c972993543d40ad6e619f7f5cfc227b7089 /tests/auto/qml/qqmlproperty | |
parent | 8d587c9fed01a2a36c1c0e2f5fb10763c5b0c7c5 (diff) |
Fix regression involving aliases on case-insensitive file systems
When initializing a QQmlProperty with the following syntax:
QQmlProperty property(root, "testType.objectName", QQmlEngine::contextForObject(root));
only try to look up types (for each token after splitting on the '.')
if the token starts with an uppercase letter, as 1e350a8c now enforces
that type names begin with an uppercase letter.
Task-number: QTBUG-66715
Change-Id: Iab64be1deb971dca256fc65d358c773837222a57
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'tests/auto/qml/qqmlproperty')
-rw-r--r-- | tests/auto/qml/qqmlproperty/data/aliasToIdWithMatchingQmlFileName.qml | 9 | ||||
-rw-r--r-- | tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp | 12 |
2 files changed, 21 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlproperty/data/aliasToIdWithMatchingQmlFileName.qml b/tests/auto/qml/qqmlproperty/data/aliasToIdWithMatchingQmlFileName.qml new file mode 100644 index 0000000000..8cbd928f36 --- /dev/null +++ b/tests/auto/qml/qqmlproperty/data/aliasToIdWithMatchingQmlFileName.qml @@ -0,0 +1,9 @@ +import QtQuick 2.0 + +Item { + property alias testType: testType + + Rectangle { + id: testType + } +} diff --git a/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp b/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp index 128dc21b9a..1e9ba80264 100644 --- a/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp +++ b/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp @@ -143,6 +143,7 @@ private slots: void registeredCompositeTypeProperty(); void deeplyNestedObject(); void readOnlyDynamicProperties(); + void aliasToIdWithMatchingQmlFileNameOnCaseInsensitiveFileSystem(); void floatToStringPrecision_data(); void floatToStringPrecision(); @@ -2047,6 +2048,17 @@ void tst_qqmlproperty::readOnlyDynamicProperties() delete obj; } +void tst_qqmlproperty::aliasToIdWithMatchingQmlFileNameOnCaseInsensitiveFileSystem() +{ + const QUrl url = testFileUrl("aliasToIdWithMatchingQmlFileName.qml"); + QQmlEngine engine; + QQmlComponent component(&engine, url); + QScopedPointer<QObject> root(component.create()); + + QQmlProperty property(root.data(), "testType.objectName", QQmlEngine::contextForObject(root.data())); + QVERIFY(property.isValid()); +} + void tst_qqmlproperty::floatToStringPrecision_data() { QTest::addColumn<QString>("propertyName"); |