aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp')
-rw-r--r--tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
index 8bb88e624c..85490f3ab3 100644
--- a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
+++ b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
@@ -143,6 +143,7 @@ private slots:
void signatureIgnored();
void listAsArgument();
void letAndConst();
+ void signalIndexMismatch();
};
void tst_QmlCppCodegen::initTestCase()
@@ -2777,6 +2778,21 @@ void tst_QmlCppCodegen::letAndConst()
QCOMPARE(o->objectName(), u"ab"_s);
}
+void tst_QmlCppCodegen::signalIndexMismatch()
+{
+ QQmlEngine engine;
+
+ QQmlComponent c1(&engine, QUrl(u"qrc:/qt/qml/TestTypes/signalIndexMismatch.qml"_s));
+ QVERIFY2(c1.isReady(), qPrintable(c1.errorString()));
+
+ QScopedPointer<QObject> item(c1.create());
+ const auto visualIndexBeforeMoveList = item->property("visualIndexBeforeMove").toList();
+ const auto visualIndexAfterMoveList = item->property("visualIndexAfterMove").toList();
+
+ QCOMPARE(visualIndexBeforeMoveList, QList<QVariant>({ 0, 1, 2 }));
+ QCOMPARE(visualIndexAfterMoveList, QList<QVariant>({ 0, 1, 2 }));
+};
+
QTEST_MAIN(tst_QmlCppCodegen)
#include "tst_qmlcppcodegen.moc"