aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmldelegatemodel
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2024-02-14 17:06:54 +0100
committerUlf Hermann <ulf.hermann@qt.io>2024-02-21 14:27:54 +0100
commit7b4221002e12716868ff21d462bc427795db4e37 (patch)
tree630ab0db3b4a7b2f90523f9608034c97fa394a50 /tests/auto/qml/qqmldelegatemodel
parente2611e8ee948b32a627277bb9783ce8f35cc2d69 (diff)
QmlModels: Restore bug-compatibility with 6.6
You can only override model properties if the model is a QAIM. Amends commit 4dbd70b5a45f4a33e8ab6d4076be612d978a4ef8 Pick-to: 6.7 Task-number: QTBUG-120499 Change-Id: I7348e3146ac19b56a2e8bac2a1e0b27e420ccc97 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/auto/qml/qqmldelegatemodel')
-rw-r--r--tests/auto/qml/qqmldelegatemodel/tst_qqmldelegatemodel.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/auto/qml/qqmldelegatemodel/tst_qqmldelegatemodel.cpp b/tests/auto/qml/qqmldelegatemodel/tst_qqmldelegatemodel.cpp
index e3fa762b25..01aa9a5937 100644
--- a/tests/auto/qml/qqmldelegatemodel/tst_qqmldelegatemodel.cpp
+++ b/tests/auto/qml/qqmldelegatemodel/tst_qqmldelegatemodel.cpp
@@ -493,13 +493,14 @@ void tst_QQmlDelegateModel::overriddenModelData()
QObject *delegate = delegateModel->object(0);
QVERIFY(delegate);
- if (i == 2) {
+ if (i == 1 || i == 2) {
+ // You can actually not override if the model is a QObject or a JavaScript array.
// Someone is certainly relying on this.
// We need to find a migration mechanism to fix it.
- QEXPECT_FAIL("", "You can actually not override if the model is a QObject", Continue);
+ QCOMPARE(delegate->objectName(), QLatin1String(" 0 0 e 0"));
+ } else {
+ QCOMPARE(delegate->objectName(), QLatin1String("a b c d e f"));
}
-
- QCOMPARE(delegate->objectName(), QLatin1String("a b c d e f"));
}
}