aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2020-01-25 01:00:10 +0100
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2020-01-25 01:00:11 +0100
commit9893e71cea5de10193376c1733db627ef0783614 (patch)
tree391fabceb9d4ff6ba5f3ff2c2ec42acb613eb4ef /tests
parent87e7203532d69e0aaa0898a972d1d90fa589d519 (diff)
parente1b4b267aa8c4d9c53e5af4def54f5e9e14e0103 (diff)
Merge remote-tracking branch 'origin/5.15' into dev
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qml/debugger/qdebugmessageservice/tst_qdebugmessageservice.cpp3
-rw-r--r--tests/auto/qml/ecmascripttests/BLACKLIST4
-rw-r--r--tests/auto/qml/qjsengine/tst_qjsengine.cpp29
-rw-r--r--tests/auto/qml/qqmlapplicationengine/data/i18n/qml_de_CH.qmbin0 -> 101 bytes
-rw-r--r--tests/auto/qml/qqmlapplicationengine/data/i18n/qml_de_CH.ts11
-rw-r--r--tests/auto/qml/qqmlapplicationengine/tst_qqmlapplicationengine.cpp23
-rw-r--r--tests/auto/qml/qqmlengine/data/uiLanguage.qml9
-rw-r--r--tests/auto/qml/qqmlengine/tst_qqmlengine.cpp33
-rw-r--r--tests/auto/qml/qqmllanguage/data/InlineComponentBase.qml9
-rw-r--r--tests/auto/qml/qqmllanguage/data/InlineComponentChild.qml7
-rw-r--r--tests/auto/qml/qqmllanguage/data/InlineComponentProvider.qml9
-rw-r--r--tests/auto/qml/qqmllanguage/data/InlineComponentProvider2.qml10
-rw-r--r--tests/auto/qml/qqmllanguage/data/InlineComponentProvider3.qml11
-rw-r--r--tests/auto/qml/qqmllanguage/data/InlineComponentProviderChild.qml1
-rw-r--r--tests/auto/qml/qqmllanguage/data/InlineComponentReexporter.qml8
-rw-r--r--tests/auto/qml/qqmllanguage/data/icCycleViaProperty.qml9
-rw-r--r--tests/auto/qml/qqmllanguage/data/icSimpleCycle.qml6
-rw-r--r--tests/auto/qml/qqmllanguage/data/inlineComponentOrder.qml20
-rw-r--r--tests/auto/qml/qqmllanguage/data/inlineComponentUser1.qml13
-rw-r--r--tests/auto/qml/qqmllanguage/data/inlineComponentUser2.qml10
-rw-r--r--tests/auto/qml/qqmllanguage/data/inlineComponentUser3.qml16
-rw-r--r--tests/auto/qml/qqmllanguage/data/inlineComponentUser4.qml12
-rw-r--r--tests/auto/qml/qqmllanguage/data/inlineComponentUser5.qml11
-rw-r--r--tests/auto/qml/qqmllanguage/data/invalidRoot.4.errors.txt2
-rw-r--r--tests/auto/qml/qqmllanguage/data/invalidTypeName.4.errors.txt2
-rw-r--r--tests/auto/qml/qqmllanguage/data/nestedIC.qml7
-rw-r--r--tests/auto/qml/qqmllanguage/data/nonExistingICUser1.qml5
-rw-r--r--tests/auto/qml/qqmllanguage/data/nonExistingICUser2.qml5
-rw-r--r--tests/auto/qml/qqmllanguage/data/nonExistingICUser3.qml3
-rw-r--r--tests/auto/qml/qqmllanguage/data/nonExistingICUser4.qml6
-rw-r--r--tests/auto/qml/qqmllanguage/data/nonExistingICUser5.qml5
-rw-r--r--tests/auto/qml/qqmllanguage/data/singleton/SingletonTypeWithIC.qml16
-rw-r--r--tests/auto/qml/qqmllanguage/data/singleton/qmldir1
-rw-r--r--tests/auto/qml/qqmllanguage/data/singletonICTest.qml6
-rw-r--r--tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp136
-rw-r--r--tests/auto/qml/qqmllistmodel/qqmllistmodel.pro2
-rw-r--r--tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp2
-rw-r--r--tests/auto/qmltest/animatedimage/BLACKLIST2
-rw-r--r--tests/auto/qmltest/listview/data/MultiDelegate3.qml97
-rw-r--r--tests/auto/qmltest/listview/tst_listview.qml17
-rw-r--r--tests/auto/qmltest/textedit/BLACKLIST4
-rw-r--r--tests/auto/quick/qquickcanvasitem/BLACKLIST14
-rw-r--r--tests/auto/quick/qquickitem2/data/mapCoordinates.qml20
-rw-r--r--tests/auto/quick/qquickitem2/data/mapCoordinatesRect.qml10
-rw-r--r--tests/auto/quick/qquickitem2/tst_qquickitem.cpp24
-rw-r--r--tests/auto/quick/qquicklistview/BLACKLIST4
-rw-r--r--tests/auto/quick/qquicktext/BLACKLIST2
-rwxr-xr-xtests/manual/nodetypes_ng/compile.bat (renamed from tests/manual/nodetypes_ng/buildshaders.bat)0
-rw-r--r--tests/manual/nodetypes_ng/shadow_pass1.frag.qsbbin1876 -> 1822 bytes
-rw-r--r--tests/manual/nodetypes_ng/shadow_pass2.frag.qsbbin1790 -> 1745 bytes
-rw-r--r--tests/manual/nodetypes_ng/wobble.frag.qsbbin1673 -> 1627 bytes
-rw-r--r--tests/manual/nodetypes_ng/wobble.vert.qsbbin1678 -> 1641 bytes
-rw-r--r--tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/basic.fragbin838 -> 813 bytes
-rw-r--r--tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/cmyk.fragbin1959 -> 1923 bytes
-rw-r--r--tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/culling.fragbin1263 -> 1238 bytes
-rw-r--r--tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/edge.fragbin1890 -> 1831 bytes
-rw-r--r--tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/gradient.fragbin1099 -> 1061 bytes
-rw-r--r--tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/gradient2.fragbin1089 -> 1064 bytes
-rw-r--r--tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/gradient3.fragbin1089 -> 1059 bytes
-rw-r--r--tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/gradient4.fragbin1092 -> 1057 bytes
-rw-r--r--tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/gradient5.fragbin1089 -> 1050 bytes
-rw-r--r--tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/shadow.fragbin2092 -> 2041 bytes
-rw-r--r--tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/stencil.fragbin1141 -> 1122 bytes
-rw-r--r--tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/wave.vertbin1867 -> 1799 bytes
64 files changed, 642 insertions, 14 deletions
diff --git a/tests/auto/qml/debugger/qdebugmessageservice/tst_qdebugmessageservice.cpp b/tests/auto/qml/debugger/qdebugmessageservice/tst_qdebugmessageservice.cpp
index d2cfd3897a..1c1f785560 100644
--- a/tests/auto/qml/debugger/qdebugmessageservice/tst_qdebugmessageservice.cpp
+++ b/tests/auto/qml/debugger/qdebugmessageservice/tst_qdebugmessageservice.cpp
@@ -88,8 +88,7 @@ public:
QList<LogEntry> logBuffer;
protected:
- //inherited from QQmlDebugClient
- void messageReceived(const QByteArray &data);
+ void messageReceived(const QByteArray &data) override;
signals:
void debugOutput();
diff --git a/tests/auto/qml/ecmascripttests/BLACKLIST b/tests/auto/qml/ecmascripttests/BLACKLIST
new file mode 100644
index 0000000000..1ed255e9e2
--- /dev/null
+++ b/tests/auto/qml/ecmascripttests/BLACKLIST
@@ -0,0 +1,4 @@
+[runInterpreted]
+macos ci
+[runJitted]
+macos
diff --git a/tests/auto/qml/qjsengine/tst_qjsengine.cpp b/tests/auto/qml/qjsengine/tst_qjsengine.cpp
index 28efb519ee..7b59087a72 100644
--- a/tests/auto/qml/qjsengine/tst_qjsengine.cpp
+++ b/tests/auto/qml/qjsengine/tst_qjsengine.cpp
@@ -264,6 +264,8 @@ private slots:
void printCircularArray();
void typedArraySet();
+ void uiLanguage();
+
public:
Q_INVOKABLE QJSValue throwingCppMethod1();
Q_INVOKABLE void throwingCppMethod2();
@@ -5143,6 +5145,33 @@ void tst_QJSEngine::typedArraySet()
}
}
+void tst_QJSEngine::uiLanguage()
+{
+ {
+ QJSEngine engine;
+
+ QVERIFY(!engine.globalObject().hasProperty("Qt"));
+
+ engine.installExtensions(QJSEngine::TranslationExtension);
+ QVERIFY(engine.globalObject().hasProperty("Qt"));
+ QVERIFY(engine.globalObject().property("Qt").hasProperty("uiLanguage"));
+
+ engine.setUiLanguage("Blah");
+ QCOMPARE(engine.globalObject().property("Qt").property("uiLanguage").toString(), "Blah");
+
+ engine.evaluate("Qt.uiLanguage = \"another\"");
+ QCOMPARE(engine.globalObject().property("Qt").property("uiLanguage").toString(), "another");
+ }
+
+ {
+ QQmlEngine qmlEngine;
+ QVERIFY(qmlEngine.globalObject().hasProperty("Qt"));
+ QVERIFY(qmlEngine.globalObject().property("Qt").hasProperty("uiLanguage"));
+ qmlEngine.setUiLanguage("Blah");
+ QCOMPARE(qmlEngine.globalObject().property("Qt").property("uiLanguage").toString(), "Blah");
+ }
+}
+
QTEST_MAIN(tst_QJSEngine)
#include "tst_qjsengine.moc"
diff --git a/tests/auto/qml/qqmlapplicationengine/data/i18n/qml_de_CH.qm b/tests/auto/qml/qqmlapplicationengine/data/i18n/qml_de_CH.qm
new file mode 100644
index 0000000000..926d74f905
--- /dev/null
+++ b/tests/auto/qml/qqmlapplicationengine/data/i18n/qml_de_CH.qm
Binary files differ
diff --git a/tests/auto/qml/qqmlapplicationengine/data/i18n/qml_de_CH.ts b/tests/auto/qml/qqmlapplicationengine/data/i18n/qml_de_CH.ts
new file mode 100644
index 0000000000..2105cfb2cf
--- /dev/null
+++ b/tests/auto/qml/qqmlapplicationengine/data/i18n/qml_de_CH.ts
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.1" language="de_CH" sourcelanguage="en">
+<context>
+ <name>loadTranslation</name>
+ <message>
+ <source>translate it</source>
+ <translation>Grüezi</translation>
+ </message>
+</context>
+</TS>
diff --git a/tests/auto/qml/qqmlapplicationengine/tst_qqmlapplicationengine.cpp b/tests/auto/qml/qqmlapplicationengine/tst_qqmlapplicationengine.cpp
index 5e855efe1a..b019ff4535 100644
--- a/tests/auto/qml/qqmlapplicationengine/tst_qqmlapplicationengine.cpp
+++ b/tests/auto/qml/qqmlapplicationengine/tst_qqmlapplicationengine.cpp
@@ -53,6 +53,7 @@ private slots:
void removeObjectsWhenDestroyed();
void loadTranslation_data();
void loadTranslation();
+ void translationChange();
void setInitialProperties();
void failureToLoadTriggersWarningSignal();
@@ -278,6 +279,28 @@ void tst_qqmlapplicationengine::loadTranslation()
QCOMPARE(rootObject->property("translation").toString(), translation);
}
+void tst_qqmlapplicationengine::translationChange()
+{
+ if (QLocale().language() == QLocale::SwissGerman) {
+ QSKIP("Skipping this when running under the Swiss locale as we would always load translation.");
+ }
+
+ QQmlApplicationEngine engine(testFileUrl("loadTranslation.qml"));
+
+ QCOMPARE(engine.uiLanguage(), QLocale().bcp47Name());
+
+ QObject *rootObject = engine.rootObjects().first();
+ QVERIFY(rootObject);
+
+ QCOMPARE(rootObject->property("translation").toString(), "translated");
+
+ engine.setUiLanguage("de_CH");
+ QCOMPARE(rootObject->property("translation").toString(), QString::fromUtf8("Gr\u00FCezi"));
+
+ engine.setUiLanguage(QString());
+ QCOMPARE(rootObject->property("translation").toString(), "translate it");
+}
+
void tst_qqmlapplicationengine::setInitialProperties()
{
QQmlApplicationEngine test {};
diff --git a/tests/auto/qml/qqmlengine/data/uiLanguage.qml b/tests/auto/qml/qqmlengine/data/uiLanguage.qml
new file mode 100644
index 0000000000..bc20351245
--- /dev/null
+++ b/tests/auto/qml/qqmlengine/data/uiLanguage.qml
@@ -0,0 +1,9 @@
+import QtQml 2.15
+QtObject {
+ property string chosenLanguage: Qt.uiLanguage
+ property string textToTranslate: {
+ numberOfTranslationBindingEvaluations++;
+ return qsTr("Translate me maybe");
+ }
+ property int numberOfTranslationBindingEvaluations: 0
+}
diff --git a/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp b/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp
index d782df3e7f..ab4c083b65 100644
--- a/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp
+++ b/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp
@@ -84,6 +84,7 @@ private slots:
void aggressiveGc();
void cachedGetterLookup_qtbug_75335();
void createComponentOnSingletonDestruction();
+ void uiLanguage();
public slots:
QObject *createAQObjectForOwnershipTest ()
@@ -1175,6 +1176,38 @@ void tst_qqmlengine::createComponentOnSingletonDestruction()
QVERIFY(obj);
}
+void tst_qqmlengine::uiLanguage()
+{
+ QQmlEngine engine;
+
+ QObject::connect(&engine, &QJSEngine::uiLanguageChanged, [&engine]() {
+ engine.retranslate();
+ });
+
+ QSignalSpy uiLanguageChangeSpy(&engine, SIGNAL(uiLanguageChanged()));
+
+ QQmlComponent component(&engine, testFileUrl("uiLanguage.qml"));
+
+ QTest::ignoreMessage(QtMsgType::QtWarningMsg, (component.url().toString() + ":2:1: QML QtObject: Binding loop detected for property \"textToTranslate\"").toLatin1());
+ QScopedPointer<QObject> object(component.create());
+ QVERIFY(!object.isNull());
+
+ QVERIFY(engine.uiLanguage().isEmpty());
+ QCOMPARE(object->property("numberOfTranslationBindingEvaluations").toInt(), 1);
+
+ QTest::ignoreMessage(QtMsgType::QtWarningMsg, (component.url().toString() + ":2:1: QML QtObject: Binding loop detected for property \"textToTranslate\"").toLatin1());
+ engine.setUiLanguage("TestLanguage");
+ QCOMPARE(object->property("numberOfTranslationBindingEvaluations").toInt(), 2);
+ QCOMPARE(object->property("chosenLanguage").toString(), "TestLanguage");
+
+
+ QTest::ignoreMessage(QtMsgType::QtWarningMsg, (component.url().toString() + ":2:1: QML QtObject: Binding loop detected for property \"textToTranslate\"").toLatin1());
+ engine.evaluate("Qt.uiLanguage = \"anotherLanguage\"");
+ QCOMPARE(engine.uiLanguage(), QString("anotherLanguage"));
+ QCOMPARE(object->property("numberOfTranslationBindingEvaluations").toInt(), 3);
+ QCOMPARE(object->property("chosenLanguage").toString(), "anotherLanguage");
+}
+
QTEST_MAIN(tst_qqmlengine)
#include "tst_qqmlengine.moc"
diff --git a/tests/auto/qml/qqmllanguage/data/InlineComponentBase.qml b/tests/auto/qml/qqmllanguage/data/InlineComponentBase.qml
new file mode 100644
index 0000000000..0b297a7779
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/InlineComponentBase.qml
@@ -0,0 +1,9 @@
+import QtQml 2.15
+
+QtObject {
+ property alias i: icInstance.i
+ component IC : QtObject {
+ property int i: 42
+ }
+ property QtObject ic: IC {id: icInstance}
+}
diff --git a/tests/auto/qml/qqmllanguage/data/InlineComponentChild.qml b/tests/auto/qml/qqmllanguage/data/InlineComponentChild.qml
new file mode 100644
index 0000000000..49a90ab7da
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/InlineComponentChild.qml
@@ -0,0 +1,7 @@
+import QtQml 2.15
+
+InlineComponentBase {
+ component IC : QtObject {
+ property int i: 13
+ }
+}
diff --git a/tests/auto/qml/qqmllanguage/data/InlineComponentProvider.qml b/tests/auto/qml/qqmllanguage/data/InlineComponentProvider.qml
new file mode 100644
index 0000000000..6058e32b2f
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/InlineComponentProvider.qml
@@ -0,0 +1,9 @@
+import QtQuick 2.15
+
+Item {
+ component StyledRectangle: Rectangle {
+ width: 24
+ height: 24
+ color: "red"
+ }
+}
diff --git a/tests/auto/qml/qqmllanguage/data/InlineComponentProvider2.qml b/tests/auto/qml/qqmllanguage/data/InlineComponentProvider2.qml
new file mode 100644
index 0000000000..b5a0efaccf
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/InlineComponentProvider2.qml
@@ -0,0 +1,10 @@
+import QtQuick 2.15
+
+Item {
+ property color myColor: "red"
+ component StyledRectangle: Rectangle {
+ width: 24
+ height: 24
+ color: myColor
+ }
+}
diff --git a/tests/auto/qml/qqmllanguage/data/InlineComponentProvider3.qml b/tests/auto/qml/qqmllanguage/data/InlineComponentProvider3.qml
new file mode 100644
index 0000000000..9a4f1fd272
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/InlineComponentProvider3.qml
@@ -0,0 +1,11 @@
+import QtQuick 2.15
+
+Item {
+ Item {
+ component StyledRectangle: Rectangle {
+ width: 24
+ height: 24
+ color: "red"
+ }
+ }
+}
diff --git a/tests/auto/qml/qqmllanguage/data/InlineComponentProviderChild.qml b/tests/auto/qml/qqmllanguage/data/InlineComponentProviderChild.qml
new file mode 100644
index 0000000000..ddb55e55e6
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/InlineComponentProviderChild.qml
@@ -0,0 +1 @@
+InlineComponentProvider {}
diff --git a/tests/auto/qml/qqmllanguage/data/InlineComponentReexporter.qml b/tests/auto/qml/qqmllanguage/data/InlineComponentReexporter.qml
new file mode 100644
index 0000000000..24bf6f771e
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/InlineComponentReexporter.qml
@@ -0,0 +1,8 @@
+import QtQuick 2.14
+
+QtObject {
+ component StyledRectangle: InlineComponentProvider.StyledRectangle {
+ color: "green"
+ }
+
+}
diff --git a/tests/auto/qml/qqmllanguage/data/icCycleViaProperty.qml b/tests/auto/qml/qqmllanguage/data/icCycleViaProperty.qml
new file mode 100644
index 0000000000..c5aa4cfdf5
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/icCycleViaProperty.qml
@@ -0,0 +1,9 @@
+import QtQuick 2.15
+
+Item {
+ component A : Item {
+ property var test: B {}
+ }
+ component B: A {}
+ A {}
+}
diff --git a/tests/auto/qml/qqmllanguage/data/icSimpleCycle.qml b/tests/auto/qml/qqmllanguage/data/icSimpleCycle.qml
new file mode 100644
index 0000000000..69e74f7c96
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/icSimpleCycle.qml
@@ -0,0 +1,6 @@
+import QtQuick 2.15
+
+Item {
+ component A : B {}
+ component B: A {}
+}
diff --git a/tests/auto/qml/qqmllanguage/data/inlineComponentOrder.qml b/tests/auto/qml/qqmllanguage/data/inlineComponentOrder.qml
new file mode 100644
index 0000000000..a96f68e56a
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/inlineComponentOrder.qml
@@ -0,0 +1,20 @@
+import QtQuick 2.15
+
+Item {
+ width: 600
+ height: 480
+ IC2 {
+ objectName: "icInstance"
+ anchors.centerIn: parent
+ }
+
+ component IC2: IC1 {}
+ component IC0: Rectangle {
+ height: 200
+ width: 200
+ color: "blue"
+ }
+ component IC1: IC0 {}
+
+
+}
diff --git a/tests/auto/qml/qqmllanguage/data/inlineComponentUser1.qml b/tests/auto/qml/qqmllanguage/data/inlineComponentUser1.qml
new file mode 100644
index 0000000000..8968a20112
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/inlineComponentUser1.qml
@@ -0,0 +1,13 @@
+import QtQuick 2.14
+
+Item {
+ width: 600
+ height: 480
+ property InlineComponentProvider.StyledRectangle myProp: InlineComponentProvider.StyledRectangle {}
+ InlineComponentProvider.StyledRectangle {
+ objectName: "icInstance"
+ anchors.centerIn: parent
+ color: "blue"
+ }
+
+}
diff --git a/tests/auto/qml/qqmllanguage/data/inlineComponentUser2.qml b/tests/auto/qml/qqmllanguage/data/inlineComponentUser2.qml
new file mode 100644
index 0000000000..dc6e3850db
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/inlineComponentUser2.qml
@@ -0,0 +1,10 @@
+import QtQuick 2.14
+
+Item {
+ width: 600
+ height: 480
+ property InlineComponentProvider.StyledRectangle myProp: InlineComponentReexporter.StyledRectangle {
+ objectName: "icInstance"
+ }
+
+}
diff --git a/tests/auto/qml/qqmllanguage/data/inlineComponentUser3.qml b/tests/auto/qml/qqmllanguage/data/inlineComponentUser3.qml
new file mode 100644
index 0000000000..c57c4cad01
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/inlineComponentUser3.qml
@@ -0,0 +1,16 @@
+import QtQuick 2.14
+
+Item {
+ width: 600
+ height: 480
+ component StyledRectangle: Rectangle {
+ width: 24
+ height: 24
+ color: "blue"
+ }
+ StyledRectangle {
+ objectName: "icInstance"
+ anchors.centerIn: parent
+ }
+
+}
diff --git a/tests/auto/qml/qqmllanguage/data/inlineComponentUser4.qml b/tests/auto/qml/qqmllanguage/data/inlineComponentUser4.qml
new file mode 100644
index 0000000000..9f3903c8df
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/inlineComponentUser4.qml
@@ -0,0 +1,12 @@
+import QtQuick 2.14
+
+Item {
+ width: 600
+ height: 480
+ property color myColor: "blue"
+ InlineComponentProvider2.StyledRectangle {
+ objectName: "icInstance"
+ anchors.centerIn: parent
+ }
+
+}
diff --git a/tests/auto/qml/qqmllanguage/data/inlineComponentUser5.qml b/tests/auto/qml/qqmllanguage/data/inlineComponentUser5.qml
new file mode 100644
index 0000000000..150d0c2ded
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/inlineComponentUser5.qml
@@ -0,0 +1,11 @@
+import QtQuick 2.15
+
+Item {
+ width: 600
+ height: 480
+ property var test: InlineComponentProvider3.StyledRectangle {
+ objectName: "icInstance"
+ anchors.centerIn: parent
+ }
+
+}
diff --git a/tests/auto/qml/qqmllanguage/data/invalidRoot.4.errors.txt b/tests/auto/qml/qqmllanguage/data/invalidRoot.4.errors.txt
index 3b90f573a2..41cb0eaac1 100644
--- a/tests/auto/qml/qqmllanguage/data/invalidRoot.4.errors.txt
+++ b/tests/auto/qml/qqmllanguage/data/invalidRoot.4.errors.txt
@@ -1 +1 @@
-3:1:Bar.Item - Bar is not a namespace
+3:1:Bar.Item - Bar is neither a type nor a namespace
diff --git a/tests/auto/qml/qqmllanguage/data/invalidTypeName.4.errors.txt b/tests/auto/qml/qqmllanguage/data/invalidTypeName.4.errors.txt
index 3b90f573a2..41cb0eaac1 100644
--- a/tests/auto/qml/qqmllanguage/data/invalidTypeName.4.errors.txt
+++ b/tests/auto/qml/qqmllanguage/data/invalidTypeName.4.errors.txt
@@ -1 +1 @@
-3:1:Bar.Item - Bar is not a namespace
+3:1:Bar.Item - Bar is neither a type nor a namespace
diff --git a/tests/auto/qml/qqmllanguage/data/nestedIC.qml b/tests/auto/qml/qqmllanguage/data/nestedIC.qml
new file mode 100644
index 0000000000..04cef64d54
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/nestedIC.qml
@@ -0,0 +1,7 @@
+import QtQuick 2.15
+
+Item {
+ component Outer : Item {
+ component Inner : Item {}
+ }
+}
diff --git a/tests/auto/qml/qqmllanguage/data/nonExistingICUser1.qml b/tests/auto/qml/qqmllanguage/data/nonExistingICUser1.qml
new file mode 100644
index 0000000000..a07a6a9838
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/nonExistingICUser1.qml
@@ -0,0 +1,5 @@
+import QtQuick 2.15
+
+Item {
+ property InlineComponentProvider.NonExisting myProp
+}
diff --git a/tests/auto/qml/qqmllanguage/data/nonExistingICUser2.qml b/tests/auto/qml/qqmllanguage/data/nonExistingICUser2.qml
new file mode 100644
index 0000000000..5c24962def
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/nonExistingICUser2.qml
@@ -0,0 +1,5 @@
+import QtQuick 2.15
+
+Item {
+ InlineComponentProvider.NotExisting {}
+}
diff --git a/tests/auto/qml/qqmllanguage/data/nonExistingICUser3.qml b/tests/auto/qml/qqmllanguage/data/nonExistingICUser3.qml
new file mode 100644
index 0000000000..34595707fc
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/nonExistingICUser3.qml
@@ -0,0 +1,3 @@
+import QtQuick 2.15
+
+InlineComponentProvider.NotExisting {}
diff --git a/tests/auto/qml/qqmllanguage/data/nonExistingICUser4.qml b/tests/auto/qml/qqmllanguage/data/nonExistingICUser4.qml
new file mode 100644
index 0000000000..2be01ccd96
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/nonExistingICUser4.qml
@@ -0,0 +1,6 @@
+import QtQuick 2.0
+import "singleton" as MySingleton
+
+Item {
+ property MySingleton.SingletonTypeWithIC.NonExisting singletonIC
+}
diff --git a/tests/auto/qml/qqmllanguage/data/nonExistingICUser5.qml b/tests/auto/qml/qqmllanguage/data/nonExistingICUser5.qml
new file mode 100644
index 0000000000..a2ca5db6de
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/nonExistingICUser5.qml
@@ -0,0 +1,5 @@
+import QtQuick 2.15
+
+Item {
+ property InlineComponentProviderChild.StyledRectangle myProp
+}
diff --git a/tests/auto/qml/qqmllanguage/data/singleton/SingletonTypeWithIC.qml b/tests/auto/qml/qqmllanguage/data/singleton/SingletonTypeWithIC.qml
new file mode 100644
index 0000000000..bd724c4aeb
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/singleton/SingletonTypeWithIC.qml
@@ -0,0 +1,16 @@
+import QtQuick 2.0
+pragma Singleton
+
+Item {
+ id: singletonId
+ component IC1: Item {
+ property int iProp: 42
+ property string sProp: "Hello, world"
+ property Rectangle myRect: Rectangle {color: "green"}
+ }
+ component IC2: Item {
+ property int iProp: 13
+ property string sProp: "Goodbye, world"
+ property Rectangle myRect: Rectangle {color: "red"}
+ }
+}
diff --git a/tests/auto/qml/qqmllanguage/data/singleton/qmldir b/tests/auto/qml/qqmllanguage/data/singleton/qmldir
index 533fb6999a..727b09b4e8 100644
--- a/tests/auto/qml/qqmllanguage/data/singleton/qmldir
+++ b/tests/auto/qml/qqmllanguage/data/singleton/qmldir
@@ -1,3 +1,4 @@
singleton SingletonType SingletonType.qml
+singleton SingletonTypeWithIC SingletonTypeWithIC.qml
diff --git a/tests/auto/qml/qqmllanguage/data/singletonICTest.qml b/tests/auto/qml/qqmllanguage/data/singletonICTest.qml
new file mode 100644
index 0000000000..d0d3b079be
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/singletonICTest.qml
@@ -0,0 +1,6 @@
+import QtQuick 2.0
+import "singleton" as MySingleton
+
+Item {
+ property MySingleton.SingletonTypeWithIC.IC1 singleton1: MySingleton.SingletonTypeWithIC.IC1 {};
+}
diff --git a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
index 089daf3ed5..4d2f773dbf 100644
--- a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
+++ b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
@@ -306,6 +306,16 @@ private slots:
void extendedForeignTypes();
+ void inlineComponent();
+ void inlineComponent_data();
+ void inlineComponentReferenceCycle_data();
+ void inlineComponentReferenceCycle();
+ void nestedInlineComponentNotAllowed();
+ void inlineComponentStaticTypeResolution();
+ void inlineComponentInSingleton();
+ void nonExistingInlineComponent_data();
+ void nonExistingInlineComponent();
+
void selfReference();
void selfReferencingSingleton();
@@ -2780,12 +2790,12 @@ void tst_qqmllanguage::importsLocal_data()
QTest::newRow("local import QTBUG-7721 A")
<< "subdir.Test {}" // no longer allowed (QTBUG-7721)
<< ""
- << "subdir.Test - subdir is not a namespace";
+ << "subdir.Test - subdir is neither a type nor a namespace";
QTest::newRow("local import QTBUG-7721 B")
<< "import \"subdir\" as X\n"
"X.subsubdir.SubTest {}" // no longer allowed (QTBUG-7721)
<< ""
- << "X.subsubdir.SubTest - nested namespaces not allowed";
+ << "X.subsubdir.SubTest - subsubdir is not a type";
QTest::newRow("local import as")
<< "import \"subdir\" as T\n"
"T.Test {}"
@@ -5408,6 +5418,128 @@ void tst_qqmllanguage::overrideSingleton()
check("uncreatable", "UncreatableSingleton");
}
+void tst_qqmllanguage::inlineComponent()
+{
+ QFETCH(QUrl, componentUrl);
+ QFETCH(QColor, color);
+ QFETCH(int, width);
+ QQmlEngine engine;
+ QQmlComponent component(&engine, componentUrl);
+ QScopedPointer<QObject> o(component.create());
+ if (component.isError()) {
+ qDebug() << component.errorString();
+ }
+ QVERIFY(!o.isNull());
+ auto icInstance = o->findChild<QObject *>("icInstance");
+ QVERIFY(icInstance);
+ QCOMPARE(icInstance->property("color").value<QColor>(),color);
+ QCOMPARE(icInstance->property("width").value<qreal>(), width);
+}
+
+void tst_qqmllanguage::inlineComponent_data()
+{
+ QTest::addColumn<QUrl>("componentUrl");
+ QTest::addColumn<QColor>("color");
+ QTest::addColumn<int>("width");
+
+ QTest::newRow("Usage from other component") << testFileUrl("inlineComponentUser1.qml") << QColorConstants::Blue << 24;
+ QTest::newRow("Reexport") << testFileUrl("inlineComponentUser2.qml") << QColorConstants::Svg::green << 24;
+ QTest::newRow("Usage in same component") << testFileUrl("inlineComponentUser3.qml") << QColorConstants::Blue << 24;
+
+ QTest::newRow("Resolution happens at instantiation") << testFileUrl("inlineComponentUser4.qml") << QColorConstants::Blue << 24;
+ QTest::newRow("Non-toplevel IC is found") << testFileUrl("inlineComponentUser5.qml") << QColorConstants::Svg::red << 24;
+
+ QTest::newRow("Resolved in correct order") << testFileUrl("inlineComponentOrder.qml") << QColorConstants::Blue << 200;
+}
+
+void tst_qqmllanguage::inlineComponentReferenceCycle_data()
+{
+ QTest::addColumn<QUrl>("componentUrl");
+
+ QTest::newRow("Simple cycle") << testFileUrl("icSimpleCycle.qml");
+ QTest::newRow("Via property") << testFileUrl("icCycleViaProperty.qml");
+}
+
+void tst_qqmllanguage::inlineComponentReferenceCycle()
+{
+ QFETCH(QUrl, componentUrl);
+ QQmlEngine engine;
+ QTest::ignoreMessage(QtMsgType::QtWarningMsg, "QQmlComponent: Component is not ready");
+ QQmlComponent component(&engine, componentUrl);
+ QScopedPointer<QObject> o(component.create());
+ QVERIFY(o.isNull());
+ QVERIFY(component.isError());
+ QCOMPARE(component.errorString(), componentUrl.toString() + QLatin1String(":-1 Inline components form a cycle!\n"));
+}
+
+void tst_qqmllanguage::nestedInlineComponentNotAllowed()
+{
+ QQmlEngine engine;
+ auto url = testFileUrl("nestedIC.qml");
+ QQmlComponent component(&engine, url);
+ QTest::ignoreMessage(QtMsgType::QtWarningMsg, "QQmlComponent: Component is not ready");
+ QScopedPointer<QObject> o(component.create());
+ QVERIFY(component.isError());
+ QCOMPARE(component.errorString(), QLatin1String("%1:%2").arg(url.toString(), QLatin1String("5 Nested inline components are not supported\n")));
+}
+
+void tst_qqmllanguage::inlineComponentStaticTypeResolution()
+{
+ QQmlEngine engine;
+ QQmlComponent component(&engine, testFileUrl("InlineComponentChild.qml"));
+ VERIFY_ERRORS(0);
+ QScopedPointer<QObject> o(component.create());
+ QVERIFY(o);
+ QCOMPARE(o->property("i").toInt(), 42);
+}
+
+void tst_qqmllanguage::inlineComponentInSingleton()
+{
+ QQmlEngine engine;
+ QQmlComponent component(&engine, testFileUrl("singletonICTest.qml"));
+ VERIFY_ERRORS(0);
+ QScopedPointer<QObject> o(component.create());
+ QVERIFY(!o.isNull());
+ auto untyped = o->property("singleton1");
+ QVERIFY(untyped.isValid());
+ auto singleton1 = untyped.value<QObject*>();
+ QVERIFY(singleton1);
+ QCOMPARE(singleton1->property("iProp").value<int>(), 42);
+ QCOMPARE(singleton1->property("sProp").value<QString>(), QString::fromLatin1("Hello, world"));
+ QVERIFY(!o.isNull());
+}
+
+void tst_qqmllanguage::nonExistingInlineComponent_data()
+{
+ QTest::addColumn<QUrl>("componentUrl");
+ QTest::addColumn<QString>("errorMessage");
+ QTest::addColumn<int>("line");
+ QTest::addColumn<int>("column");
+
+ QTest::newRow("Property type") << testFileUrl("nonExistingICUser1.qml") << QString("Type InlineComponentProvider has no inline component type called NonExisting") << 4 << 5;
+ QTest::newRow("Instantiation") << testFileUrl("nonExistingICUser2.qml") << QString("Type InlineComponentProvider has no inline component type called NotExisting") << 4 << 5;
+ QTest::newRow("Inheritance") << testFileUrl("nonExistingICUser3.qml") << QString("Type InlineComponentProvider has no inline component type called NotExisting") << 3 << 1;
+ QTest::newRow("From singleton") << testFileUrl("nonExistingICUser4.qml") << QString("Type MySingleton.SingletonTypeWithIC has no inline component type called NonExisting") << 5 << 5;
+
+ QTest::newRow("Cannot access parent inline components from child") << testFileUrl("nonExistingICUser5.qml") << QString("Type InlineComponentProviderChild has no inline component type called StyledRectangle") << 4 << 5;
+}
+
+void tst_qqmllanguage::nonExistingInlineComponent()
+{
+ QFETCH(QUrl, componentUrl);
+ QFETCH(QString, errorMessage);
+ QFETCH(int, line);
+ QFETCH(int, column);
+ QQmlEngine engine;
+ QQmlComponent component(&engine, componentUrl);
+ auto errors = component.errors();
+ QCOMPARE(errors.size(), 1);
+ const auto &error = errors.first();
+ QCOMPARE(error.description(), errorMessage);
+ QCOMPARE(error.line(), line);
+ QCOMPARE(error.column(), column);
+}
+
QTEST_MAIN(tst_qqmllanguage)
#include "tst_qqmllanguage.moc"
diff --git a/tests/auto/qml/qqmllistmodel/qqmllistmodel.pro b/tests/auto/qml/qqmllistmodel/qqmllistmodel.pro
index 4d44d6b22b..c0808f8599 100644
--- a/tests/auto/qml/qqmllistmodel/qqmllistmodel.pro
+++ b/tests/auto/qml/qqmllistmodel/qqmllistmodel.pro
@@ -8,4 +8,4 @@ include (../../shared/util.pri)
TESTDATA = data/*
-QT += core-private gui-private qml-private quick-private testlib qmlmodels-private
+QT += core-private gui-private qml-private quick-private testlib qmlmodels-private
diff --git a/tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp b/tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp
index 75a932b6f4..d54e3467b7 100644
--- a/tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp
+++ b/tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp
@@ -700,7 +700,7 @@ void tst_qqmllistmodel::error_data()
QTest::newRow("unknown qualified ListElement not allowed")
<< "import QtQuick 2.0\nListModel { Foo.ListElement { a: 123 } }"
- << "Foo.ListElement - Foo is not a namespace";
+ << "Foo.ListElement - Foo is neither a type nor a namespace";
}
void tst_qqmllistmodel::error()
diff --git a/tests/auto/qmltest/animatedimage/BLACKLIST b/tests/auto/qmltest/animatedimage/BLACKLIST
index 3a5ed393ea..25eb7a7cff 100644
--- a/tests/auto/qmltest/animatedimage/BLACKLIST
+++ b/tests/auto/qmltest/animatedimage/BLACKLIST
@@ -1,2 +1,2 @@
[AnimatedImage::test_crashRaceCondition_replyFinished]
-osx-10.13
+macos
diff --git a/tests/auto/qmltest/listview/data/MultiDelegate3.qml b/tests/auto/qmltest/listview/data/MultiDelegate3.qml
new file mode 100644
index 0000000000..75116e0f9b
--- /dev/null
+++ b/tests/auto/qmltest/listview/data/MultiDelegate3.qml
@@ -0,0 +1,97 @@
+/****************************************************************************
+**
+** Copyright (C) 2020 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.12
+import QtQml.Models 2.12
+import Qt.labs.qmlmodels 1.0
+
+ListView {
+ width: 400
+ height: 400
+
+ property var item1: QtObject {
+ property string dataType: "rect"
+ property color color: "red"
+ }
+ property var item2: QtObject {
+ property string dataType: "text"
+ property string text: "Hello world"
+ }
+ model: [ item1, item2 ]
+
+ delegate: DelegateChooser {
+ role: "dataType"
+ DelegateChoice {
+ roleValue: "rect"
+ delegate: Rectangle {
+ width: parent.width
+ height: 50
+ color: modelData.color
+ }
+ }
+ DelegateChoice {
+ roleValue: "text"
+ delegate: Text {
+ width: parent.width
+ height: 50
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+ text: modelData.text
+ }
+ }
+
+ DelegateChoice {
+ delegate: Item {
+ width: parent.width
+ height: 50
+ }
+ }
+ }
+}
diff --git a/tests/auto/qmltest/listview/tst_listview.qml b/tests/auto/qmltest/listview/tst_listview.qml
index 5e9bb22e8e..bea6b45c3a 100644
--- a/tests/auto/qmltest/listview/tst_listview.qml
+++ b/tests/auto/qmltest/listview/tst_listview.qml
@@ -213,6 +213,10 @@ Item {
id: multiDelegate2
}
+ MultiDelegate3 {
+ id: multiDelegate3
+ }
+
TestCase {
name: "ListView"
when: windowShown
@@ -414,5 +418,18 @@ Item {
var delegate = multiDelegate2.itemAt(10, row.y)
compare(delegate.choiceType, row.type)
}
+
+ function test_multipleDelegates3_data() {
+ return [
+ { y: 25, type: "Rectangle", property: "color", value: "#ff0000" },
+ { y: 75, type: "Text", property: "text", value: "Hello world" }
+ ]
+ }
+
+ function test_multipleDelegates3(row) {
+ var delegate = multiDelegate3.itemAt(10, row.y)
+ verify(delegate.toString().includes(row.type))
+ compare(delegate[row.property], row.value)
+ }
}
}
diff --git a/tests/auto/qmltest/textedit/BLACKLIST b/tests/auto/qmltest/textedit/BLACKLIST
index e06cba3e8f..ac1ca6d8cf 100644
--- a/tests/auto/qmltest/textedit/BLACKLIST
+++ b/tests/auto/qmltest/textedit/BLACKLIST
@@ -1,6 +1,6 @@
# Blacklist for testing
[TextEdit::test_textentry]
-osx-10.12
+macos
[TextEdit::test_textentry_char]
-osx-10.12
+macos
diff --git a/tests/auto/quick/qquickcanvasitem/BLACKLIST b/tests/auto/quick/qquickcanvasitem/BLACKLIST
new file mode 100644
index 0000000000..21580b6730
--- /dev/null
+++ b/tests/auto/quick/qquickcanvasitem/BLACKLIST
@@ -0,0 +1,14 @@
+[arcTo::test_transform]
+macos
+[canvas::test_paint]
+macos
+[canvas::test_save]
+macos
+[canvas::test_implicitlySizedParent]
+macos ci
+[canvas::test_toDataURL]
+macos
+[fillRect::test_fillRect]
+macos
+[imagedata::test_rounding]
+macos ci
diff --git a/tests/auto/quick/qquickitem2/data/mapCoordinates.qml b/tests/auto/quick/qquickitem2/data/mapCoordinates.qml
index 596dedab90..3e34633338 100644
--- a/tests/auto/quick/qquickitem2/data/mapCoordinates.qml
+++ b/tests/auto/quick/qquickitem2/data/mapCoordinates.qml
@@ -49,11 +49,21 @@ Item {
return Qt.point(pos.x, pos.y)
}
+ function mapAToBPoint(x, y) {
+ var pos = itemA.mapToItem(itemB, Qt.point(x, y))
+ return Qt.point(pos.x, pos.y)
+ }
+
function mapAFromB(x, y) {
var pos = itemA.mapFromItem(itemB, x, y)
return Qt.point(pos.x, pos.y)
}
+ function mapAFromBPoint(x, y) {
+ var pos = itemA.mapFromItem(itemB, Qt.point(x, y))
+ return Qt.point(pos.x, pos.y)
+ }
+
function mapAToNull(x, y) {
var pos = itemA.mapToItem(null, x, y)
return Qt.point(pos.x, pos.y)
@@ -69,11 +79,21 @@ Item {
return Qt.point(pos.x, pos.y)
}
+ function mapAToGlobalPoint(x, y) {
+ var pos = itemA.mapToGlobal(Qt.point(x, y))
+ return Qt.point(pos.x, pos.y)
+ }
+
function mapAFromGlobal(x, y) {
var pos = itemA.mapFromGlobal(x, y)
return Qt.point(pos.x, pos.y)
}
+ function mapAFromGlobalPoint(x, y) {
+ var pos = itemA.mapFromGlobal(Qt.point(x, y))
+ return Qt.point(pos.x, pos.y)
+ }
+
function mapOrphanToGlobal(x, y) {
var obj = itemComponent.createObject(null);
var pos = obj.mapToGlobal(x, y)
diff --git a/tests/auto/quick/qquickitem2/data/mapCoordinatesRect.qml b/tests/auto/quick/qquickitem2/data/mapCoordinatesRect.qml
index 2b856a27fc..c66d1e89b6 100644
--- a/tests/auto/quick/qquickitem2/data/mapCoordinatesRect.qml
+++ b/tests/auto/quick/qquickitem2/data/mapCoordinatesRect.qml
@@ -45,11 +45,21 @@ Item {
return Qt.rect(pos.x, pos.y, pos.width, pos.height)
}
+ function mapAToBRect(x, y, w, h) {
+ var pos = itemA.mapToItem(itemB, Qt.rect(x, y, w, h))
+ return Qt.rect(pos.x, pos.y, pos.width, pos.height)
+ }
+
function mapAFromB(x, y, w, h) {
var pos = itemA.mapFromItem(itemB, x, y, w, h)
return Qt.rect(pos.x, pos.y, pos.width, pos.height)
}
+ function mapAFromBRect(x, y, w, h) {
+ var pos = itemA.mapFromItem(itemB, Qt.rect(x, y, w, h))
+ return Qt.rect(pos.x, pos.y, pos.width, pos.height)
+ }
+
function mapAToNull(x, y, w, h) {
var pos = itemA.mapToItem(null, x, y, w, h)
return Qt.rect(pos.x, pos.y, pos.width, pos.height)
diff --git a/tests/auto/quick/qquickitem2/tst_qquickitem.cpp b/tests/auto/quick/qquickitem2/tst_qquickitem.cpp
index 607cf91bfe..a1b4a70217 100644
--- a/tests/auto/quick/qquickitem2/tst_qquickitem.cpp
+++ b/tests/auto/quick/qquickitem2/tst_qquickitem.cpp
@@ -2391,10 +2391,18 @@ void tst_QQuickItem::mapCoordinates()
Q_RETURN_ARG(QVariant, result), Q_ARG(QVariant, x), Q_ARG(QVariant, y)));
QCOMPARE(result.value<QPointF>(), qobject_cast<QQuickItem*>(a)->mapToItem(b, QPointF(x, y)));
+ QVERIFY(QMetaObject::invokeMethod(root, "mapAToBPoint",
+ Q_RETURN_ARG(QVariant, result), Q_ARG(QVariant, x), Q_ARG(QVariant, y)));
+ QCOMPARE(result.value<QPointF>(), qobject_cast<QQuickItem*>(a)->mapToItem(b, QPointF(x, y)));
+
QVERIFY(QMetaObject::invokeMethod(root, "mapAFromB",
Q_RETURN_ARG(QVariant, result), Q_ARG(QVariant, x), Q_ARG(QVariant, y)));
QCOMPARE(result.value<QPointF>(), qobject_cast<QQuickItem*>(a)->mapFromItem(b, QPointF(x, y)));
+ QVERIFY(QMetaObject::invokeMethod(root, "mapAFromBPoint",
+ Q_RETURN_ARG(QVariant, result), Q_ARG(QVariant, x), Q_ARG(QVariant, y)));
+ QCOMPARE(result.value<QPointF>(), qobject_cast<QQuickItem*>(a)->mapFromItem(b, QPointF(x, y)));
+
QVERIFY(QMetaObject::invokeMethod(root, "mapAToNull",
Q_RETURN_ARG(QVariant, result), Q_ARG(QVariant, x), Q_ARG(QVariant, y)));
QCOMPARE(result.value<QPointF>(), qobject_cast<QQuickItem*>(a)->mapToScene(QPointF(x, y)));
@@ -2407,10 +2415,18 @@ void tst_QQuickItem::mapCoordinates()
Q_RETURN_ARG(QVariant, result), Q_ARG(QVariant, x), Q_ARG(QVariant, y)));
QCOMPARE(result.value<QPointF>(), qobject_cast<QQuickItem*>(a)->mapToGlobal(QPointF(x, y)));
+ QVERIFY(QMetaObject::invokeMethod(root, "mapAToGlobalPoint",
+ Q_RETURN_ARG(QVariant, result), Q_ARG(QVariant, x), Q_ARG(QVariant, y)));
+ QCOMPARE(result.value<QPointF>(), qobject_cast<QQuickItem*>(a)->mapToGlobal(QPointF(x, y)));
+
QVERIFY(QMetaObject::invokeMethod(root, "mapAFromGlobal",
Q_RETURN_ARG(QVariant, result), Q_ARG(QVariant, x), Q_ARG(QVariant, y)));
QCOMPARE(result.value<QPointF>(), qobject_cast<QQuickItem*>(a)->mapFromGlobal(QPointF(x, y)));
+ QVERIFY(QMetaObject::invokeMethod(root, "mapAFromGlobalPoint",
+ Q_RETURN_ARG(QVariant, result), Q_ARG(QVariant, x), Q_ARG(QVariant, y)));
+ QCOMPARE(result.value<QPointF>(), qobject_cast<QQuickItem*>(a)->mapFromGlobal(QPointF(x, y)));
+
// for orphans we are primarily testing that we don't crash.
// when orphaned the final position is the original position of the item translated by x,y
QVERIFY(QMetaObject::invokeMethod(root, "mapOrphanToGlobal",
@@ -2472,10 +2488,18 @@ void tst_QQuickItem::mapCoordinatesRect()
Q_RETURN_ARG(QVariant, result), Q_ARG(QVariant, x), Q_ARG(QVariant, y), Q_ARG(QVariant, width), Q_ARG(QVariant, height)));
QCOMPARE(result.value<QRectF>(), qobject_cast<QQuickItem*>(a)->mapRectToItem(b, QRectF(x, y, width, height)));
+ QVERIFY(QMetaObject::invokeMethod(root, "mapAToBRect",
+ Q_RETURN_ARG(QVariant, result), Q_ARG(QVariant, x), Q_ARG(QVariant, y), Q_ARG(QVariant, width), Q_ARG(QVariant, height)));
+ QCOMPARE(result.value<QRectF>(), qobject_cast<QQuickItem*>(a)->mapRectToItem(b, QRectF(x, y, width, height)));
+
QVERIFY(QMetaObject::invokeMethod(root, "mapAFromB",
Q_RETURN_ARG(QVariant, result), Q_ARG(QVariant, x), Q_ARG(QVariant, y), Q_ARG(QVariant, width), Q_ARG(QVariant, height)));
QCOMPARE(result.value<QRectF>(), qobject_cast<QQuickItem*>(a)->mapRectFromItem(b, QRectF(x, y, width, height)));
+ QVERIFY(QMetaObject::invokeMethod(root, "mapAFromBRect",
+ Q_RETURN_ARG(QVariant, result), Q_ARG(QVariant, x), Q_ARG(QVariant, y), Q_ARG(QVariant, width), Q_ARG(QVariant, height)));
+ QCOMPARE(result.value<QRectF>(), qobject_cast<QQuickItem*>(a)->mapRectFromItem(b, QRectF(x, y, width, height)));
+
QVERIFY(QMetaObject::invokeMethod(root, "mapAToNull",
Q_RETURN_ARG(QVariant, result), Q_ARG(QVariant, x), Q_ARG(QVariant, y), Q_ARG(QVariant, width), Q_ARG(QVariant, height)));
QCOMPARE(result.value<QRectF>(), qobject_cast<QQuickItem*>(a)->mapRectToScene(QRectF(x, y, width, height)));
diff --git a/tests/auto/quick/qquicklistview/BLACKLIST b/tests/auto/quick/qquicklistview/BLACKLIST
index 1f3736328a..6ef69550a4 100644
--- a/tests/auto/quick/qquicklistview/BLACKLIST
+++ b/tests/auto/quick/qquicklistview/BLACKLIST
@@ -5,10 +5,10 @@ opensuse-leap
[populateTransitions]
opensuse-42.1
[contentHeightWithDelayRemove]
-osx-10.12
+macos
#QTBUG-75960
#QTBUG-76652
[currentIndex]
-osx-10.12
+macos
opensuse-leap
ubuntu-18.04
diff --git a/tests/auto/quick/qquicktext/BLACKLIST b/tests/auto/quick/qquicktext/BLACKLIST
index 594f9af3b3..b551575e9d 100644
--- a/tests/auto/quick/qquicktext/BLACKLIST
+++ b/tests/auto/quick/qquicktext/BLACKLIST
@@ -1,7 +1,7 @@
[dependentImplicitSizes]
b2qt
qemu
-osx-10.12
+macos
[fontSizeMode]
opensuse-42.1
[contentSize]
diff --git a/tests/manual/nodetypes_ng/buildshaders.bat b/tests/manual/nodetypes_ng/compile.bat
index 328b216c07..328b216c07 100755
--- a/tests/manual/nodetypes_ng/buildshaders.bat
+++ b/tests/manual/nodetypes_ng/compile.bat
diff --git a/tests/manual/nodetypes_ng/shadow_pass1.frag.qsb b/tests/manual/nodetypes_ng/shadow_pass1.frag.qsb
index f90265a997..4c913fee08 100644
--- a/tests/manual/nodetypes_ng/shadow_pass1.frag.qsb
+++ b/tests/manual/nodetypes_ng/shadow_pass1.frag.qsb
Binary files differ
diff --git a/tests/manual/nodetypes_ng/shadow_pass2.frag.qsb b/tests/manual/nodetypes_ng/shadow_pass2.frag.qsb
index 9608763b61..4f6e6634e7 100644
--- a/tests/manual/nodetypes_ng/shadow_pass2.frag.qsb
+++ b/tests/manual/nodetypes_ng/shadow_pass2.frag.qsb
Binary files differ
diff --git a/tests/manual/nodetypes_ng/wobble.frag.qsb b/tests/manual/nodetypes_ng/wobble.frag.qsb
index 7d3105fd3c..f1766f4363 100644
--- a/tests/manual/nodetypes_ng/wobble.frag.qsb
+++ b/tests/manual/nodetypes_ng/wobble.frag.qsb
Binary files differ
diff --git a/tests/manual/nodetypes_ng/wobble.vert.qsb b/tests/manual/nodetypes_ng/wobble.vert.qsb
index 92b8ba9703..2715c84616 100644
--- a/tests/manual/nodetypes_ng/wobble.vert.qsb
+++ b/tests/manual/nodetypes_ng/wobble.vert.qsb
Binary files differ
diff --git a/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/basic.frag b/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/basic.frag
index c6da52fd32..15459ffdb9 100644
--- a/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/basic.frag
+++ b/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/basic.frag
Binary files differ
diff --git a/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/cmyk.frag b/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/cmyk.frag
index e9c48edbb9..5ef0333b6b 100644
--- a/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/cmyk.frag
+++ b/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/cmyk.frag
Binary files differ
diff --git a/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/culling.frag b/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/culling.frag
index 6f44fff112..edf2d11a93 100644
--- a/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/culling.frag
+++ b/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/culling.frag
Binary files differ
diff --git a/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/edge.frag b/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/edge.frag
index 01a1d1cb3d..aecaa621ef 100644
--- a/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/edge.frag
+++ b/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/edge.frag
Binary files differ
diff --git a/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/gradient.frag b/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/gradient.frag
index 78ac8a9c95..ef7a9c10ca 100644
--- a/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/gradient.frag
+++ b/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/gradient.frag
Binary files differ
diff --git a/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/gradient2.frag b/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/gradient2.frag
index 364fffab52..ca58580786 100644
--- a/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/gradient2.frag
+++ b/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/gradient2.frag
Binary files differ
diff --git a/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/gradient3.frag b/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/gradient3.frag
index 42bebf490a..e1fc8b0ce8 100644
--- a/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/gradient3.frag
+++ b/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/gradient3.frag
Binary files differ
diff --git a/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/gradient4.frag b/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/gradient4.frag
index ed31582cf9..2e0b809d7d 100644
--- a/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/gradient4.frag
+++ b/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/gradient4.frag
Binary files differ
diff --git a/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/gradient5.frag b/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/gradient5.frag
index 7fe041f0ae..106c2c5515 100644
--- a/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/gradient5.frag
+++ b/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/gradient5.frag
Binary files differ
diff --git a/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/shadow.frag b/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/shadow.frag
index cb3428b75f..788a047ab0 100644
--- a/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/shadow.frag
+++ b/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/shadow.frag
Binary files differ
diff --git a/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/stencil.frag b/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/stencil.frag
index ccf3633d64..e3907a90d2 100644
--- a/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/stencil.frag
+++ b/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/stencil.frag
Binary files differ
diff --git a/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/wave.vert b/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/wave.vert
index 04850feb27..14cb4e768f 100644
--- a/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/wave.vert
+++ b/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/wave.vert
Binary files differ