diff options
author | Fabian Kosmale <fabian.kosmale@qt.io> | 2020-02-11 11:21:03 +0100 |
---|---|---|
committer | Fabian Kosmale <fabian.kosmale@qt.io> | 2020-02-11 15:45:45 +0100 |
commit | 2f4c131805f4009f42abe991e0f92f096bbc55fd (patch) | |
tree | 36068f58c7e3bea9c7a3a26fac9f649e624cc6d5 /tests/auto/qml/qqmlproperty | |
parent | 2e98ccde7b89bdb45c87c154d27566215533ac76 (diff) |
Fix QQmlProperty and Connections for properties starting with '_'
We do a weird renaming for the change handler of properties starting
with '_', now we do it at least in a consistent way.
Fixes: QTBUG-82017
Change-Id: I1535a5ee462f3a344c972461f1fb954f039aa854
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'tests/auto/qml/qqmlproperty')
-rw-r--r-- | tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp b/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp index a15c00ad62..864a47e998 100644 --- a/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp +++ b/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp @@ -158,6 +158,8 @@ private slots: void copy(); void nestedQQmlPropertyMap(); + + void underscorePropertyChangeHandler(); private: QQmlEngine engine; }; @@ -2230,6 +2232,24 @@ void tst_qqmlproperty::nestedQQmlPropertyMap() QCOMPARE(success.read().toString(), QLatin1String("success")); } +void tst_qqmlproperty::underscorePropertyChangeHandler() +{ + QQmlEngine engine; + QQmlComponent component(&engine); + component.setData(R"( + import QtQuick 2.12 + + Item { + property int __withUnderScore + } + )", QUrl::fromLocalFile(".")); + QScopedPointer<QObject> root { component.create() }; + QVERIFY(root); + QQmlProperty changeHandler(root.get(), "on__WithUnderScoreChanged"); + QVERIFY(changeHandler.isValid()); + QVERIFY(changeHandler.isSignalProperty()); +} + QTEST_MAIN(tst_qqmlproperty) #include "tst_qqmlproperty.moc" |