aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlproperty
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2019-09-04 14:48:14 +0200
committerFabian Kosmale <fabian.kosmale@qt.io>2019-09-05 19:57:34 +0200
commitc550b71fb93279a1788aec809c874b779d88b987 (patch)
tree2bfa4c608c5b63292078df34f581aea0a8e2614f /tests/auto/qml/qqmlproperty
parent48174f5b356afe74929102906b17a0c13a7a8a5b (diff)
Remove assert when setting binding to alias
This assert would only ever trigger in a debug Qt build, and the code appears to work just fine for aliases. The reason for the assert seems to have been lost in time. Fixes: QTBUG-60908 Change-Id: Ibdcd8edf3b2dd549650b3aadfcce2724a50360e3 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'tests/auto/qml/qqmlproperty')
-rw-r--r--tests/auto/qml/qqmlproperty/data/aliasToBinding.qml23
-rw-r--r--tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp11
2 files changed, 34 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlproperty/data/aliasToBinding.qml b/tests/auto/qml/qqmlproperty/data/aliasToBinding.qml
new file mode 100644
index 0000000000..54f9e3f944
--- /dev/null
+++ b/tests/auto/qml/qqmlproperty/data/aliasToBinding.qml
@@ -0,0 +1,23 @@
+import QtQuick 2.7
+
+Item {
+ id: _window
+ property bool userFontStrikeout: true
+
+ Component.onCompleted: {
+ _box.font.strikeout = Qt.binding(function() { return _window.userFontStrikeout; });
+ }
+
+ Rectangle {
+ id: _box
+ width: 100
+ height: 100
+ property alias font: _text.font
+
+ Text {
+ id: _text
+ anchors.fill: parent
+ text: "Text"
+ }
+ }
+}
diff --git a/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp b/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp
index 67da768f73..ad901c4eba 100644
--- a/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp
+++ b/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp
@@ -150,6 +150,8 @@ private slots:
void floatToStringPrecision();
void copy();
+
+ void bindingToAlias();
private:
QQmlEngine engine;
};
@@ -2123,6 +2125,15 @@ void tst_qqmlproperty::initTestCase()
qmlRegisterType<MyContainer>("Test",1,0,"MyContainer");
}
+// QTBUG-60908
+void tst_qqmlproperty::bindingToAlias()
+{
+ QQmlEngine engine;
+ QQmlComponent component(&engine, testFileUrl("aliasToBinding.qml"));
+ QScopedPointer<QObject> o(component.create());
+ QVERIFY(!o.isNull());
+}
+
QTEST_MAIN(tst_qqmlproperty)
#include "tst_qqmlproperty.moc"