aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMaximilian Goldstein <max.goldstein@qt.io>2022-02-09 12:10:34 +0100
committerMaximilian Goldstein <max.goldstein@qt.io>2022-02-22 12:56:39 +0100
commit1cd6375113963fc180d88bd201db397b45e76c9d (patch)
tree50998dcc088e894cb85a1d4081dc48ae901b3bb9 /tests
parenteaf00da10a4ae10b6b26684fe5893f671ad8f631 (diff)
qmlmodels: Move QModelIndex from QtQml
Moves the QModelIndex value types from QtQml to QtQml.Models as they cannot otherwise be properly resolved in tooling. Fixes: QTBUG-100338 Change-Id: I30fc18b388974238ba8353e87ef09f57f8ceabd1 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit e2864d6aa97d246546514ec0f97263574d19ec47) Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qml/qmllint/data/qmodelIndex.qml6
-rw-r--r--tests/auto/qml/qmllint/tst_qmllint.cpp1
-rw-r--r--tests/auto/qml/qqmlitemmodels/data/modelindex.qml1
-rw-r--r--tests/auto/qml/qqmlitemmodels/data/persistentmodelindex.qml1
4 files changed, 9 insertions, 0 deletions
diff --git a/tests/auto/qml/qmllint/data/qmodelIndex.qml b/tests/auto/qml/qmllint/data/qmodelIndex.qml
new file mode 100644
index 0000000000..e0df84b68b
--- /dev/null
+++ b/tests/auto/qml/qmllint/data/qmodelIndex.qml
@@ -0,0 +1,6 @@
+import QtQml
+
+QtObject {
+ property ItemSelectionModel itemSelectionModel;
+ function row() { return itemSelectionModel.currentIndex.row; }
+}
diff --git a/tests/auto/qml/qmllint/tst_qmllint.cpp b/tests/auto/qml/qmllint/tst_qmllint.cpp
index 7057d31a66..20819b30e6 100644
--- a/tests/auto/qml/qmllint/tst_qmllint.cpp
+++ b/tests/auto/qml/qmllint/tst_qmllint.cpp
@@ -972,6 +972,7 @@ void TestQmllint::cleanQmlCode_data()
QTest::newRow("cppPropertyChangeHandlers")
<< QStringLiteral("goodCppPropertyChangeHandlers.qml");
QTest::newRow("unexportedCppBase") << QStringLiteral("unexportedCppBase.qml");
+ QTest::newRow("qmodelIndex") << QStringLiteral("qmodelIndex.qml");
}
void TestQmllint::cleanQmlCode()
diff --git a/tests/auto/qml/qqmlitemmodels/data/modelindex.qml b/tests/auto/qml/qqmlitemmodels/data/modelindex.qml
index 0d6e3624cb..2756f04120 100644
--- a/tests/auto/qml/qqmlitemmodels/data/modelindex.qml
+++ b/tests/auto/qml/qqmlitemmodels/data/modelindex.qml
@@ -1,3 +1,4 @@
+import QtQml 2.0
import Test 1.0
ItemModelsTest {
diff --git a/tests/auto/qml/qqmlitemmodels/data/persistentmodelindex.qml b/tests/auto/qml/qqmlitemmodels/data/persistentmodelindex.qml
index 13037065a6..85987bdcac 100644
--- a/tests/auto/qml/qqmlitemmodels/data/persistentmodelindex.qml
+++ b/tests/auto/qml/qqmlitemmodels/data/persistentmodelindex.qml
@@ -1,3 +1,4 @@
+import QtQml 2.0
import Test 1.0
ItemModelsTest {