aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2021-07-23 13:11:01 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-07-23 17:53:48 +0000
commit1d0ef3135fdb1c0d0f6577afde3f31476ae0cb7f (patch)
tree1a8213c6414817f5b55c7c1659980da8d01d078a /tests
parentf17866815548cce413aa2848635a68164270160c (diff)
Treat substitution free template string literals as string bindings
Before this change, they were treated as script bindings, which are less efficient, and could not be used in ListElement. Fixes: QTBUG-95139 Change-Id: Ic66052c7f58b3ffdf1b7c0c169f42b4f99df62a1 Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit e8121d93003f621a6d91e32c1539945a0779745a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp17
-rw-r--r--tests/auto/quick/examples/BLACKLIST4
2 files changed, 17 insertions, 4 deletions
diff --git a/tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp b/tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp
index 150fb82ca6..a9b6ec03a4 100644
--- a/tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp
+++ b/tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp
@@ -135,6 +135,7 @@ private slots:
void objectDestroyed();
void destroyObject();
void emptyStringNotUndefined();
+ void listElementWithTemplateString();
};
bool tst_qqmllistmodel::compareVariantList(const QVariantList &testList, QVariant object)
@@ -1839,6 +1840,22 @@ void tst_qqmllistmodel::emptyStringNotUndefined()
QCOMPARE(val.toString(), QString());
}
+void tst_qqmllistmodel::listElementWithTemplateString()
+{
+ QQmlEngine engine;
+ QQmlComponent component(&engine);
+ component.setData(R"(
+ import QtQuick
+ ListModel {
+ ListElement {
+ prop: `test`
+ }
+ })", QUrl());
+ QVERIFY2(component.isReady(), qPrintable(component.errorString()));
+ QScopedPointer<QObject> root(component.create());
+ QVERIFY(!root.isNull());
+}
+
QTEST_MAIN(tst_qqmllistmodel)
#include "tst_qqmllistmodel.moc"
diff --git a/tests/auto/quick/examples/BLACKLIST b/tests/auto/quick/examples/BLACKLIST
index 14abb3099a..a4e374347e 100644
--- a/tests/auto/quick/examples/BLACKLIST
+++ b/tests/auto/quick/examples/BLACKLIST
@@ -1,7 +1,3 @@
-# QTBUG-95139
-[sgexamples:examples/quick/views/listview/expandingdelegates.qml]
-*
-
# The following rely on qtquickcontrols2, and can be unblacklisted once QTBUG-95173 is done.
[sgexamples:examples/quick/canvas/bezierCurve/bezierCurve.qml]
*