aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qml/debugger/qqmldebugprocess/qqmldebugprocessprocess/qqmldebugprocessprocess.pro1
-rw-r--r--tests/auto/qml/debugger/shared/qqmldebugprocess.cpp2
-rw-r--r--tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp28
-rw-r--r--tests/auto/quick/qquickimage/data/pattern.pkmbin0 -> 2064 bytes
-rw-r--r--tests/auto/quick/qquickimage/tst_qquickimage.cpp8
5 files changed, 38 insertions, 1 deletions
diff --git a/tests/auto/qml/debugger/qqmldebugprocess/qqmldebugprocessprocess/qqmldebugprocessprocess.pro b/tests/auto/qml/debugger/qqmldebugprocess/qqmldebugprocessprocess/qqmldebugprocessprocess.pro
index 55a77d830d..a8eb4885d4 100644
--- a/tests/auto/qml/debugger/qqmldebugprocess/qqmldebugprocessprocess/qqmldebugprocessprocess.pro
+++ b/tests/auto/qml/debugger/qqmldebugprocess/qqmldebugprocessprocess/qqmldebugprocessprocess.pro
@@ -1,6 +1,7 @@
QT = core
macos:CONFIG -= app_bundle
CONFIG -= debug_and_release_target
+CONFIG += console
SOURCES += qqmldebugprocessprocess.cpp
DESTDIR = ../qqmldebugprocess
diff --git a/tests/auto/qml/debugger/shared/qqmldebugprocess.cpp b/tests/auto/qml/debugger/shared/qqmldebugprocess.cpp
index 816fec6a2f..201a6b1a76 100644
--- a/tests/auto/qml/debugger/shared/qqmldebugprocess.cpp
+++ b/tests/auto/qml/debugger/shared/qqmldebugprocess.cpp
@@ -47,7 +47,7 @@ QQmlDebugProcess::QQmlDebugProcess(const QString &executable, QObject *parent)
this, &QQmlDebugProcess::processAppOutput);
connect(&m_process, &QProcess::errorOccurred,
this, &QQmlDebugProcess::processError);
- connect(&m_process, static_cast<void(QProcess::*)(int)>(&QProcess::finished),
+ connect(&m_process, QOverload<int>::of(&QProcess::finished),
this, [this]() {
m_timer.stop();
m_eventLoop.quit();
diff --git a/tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp b/tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp
index 4089673d68..73aec7c55b 100644
--- a/tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp
+++ b/tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp
@@ -124,6 +124,7 @@ private slots:
void modify_through_delegate();
void bindingsOnGetResult();
void stringifyModelEntry();
+ void qobjectTrackerForDynamicModelObjects();
};
bool tst_qqmllistmodel::compareVariantList(const QVariantList &testList, QVariant object)
@@ -1505,6 +1506,33 @@ void tst_qqmllistmodel::stringifyModelEntry()
QCOMPARE(v.toString(), expectedString);
}
+void tst_qqmllistmodel::qobjectTrackerForDynamicModelObjects()
+{
+ QQmlEngine engine;
+ QQmlComponent component(&engine);
+ component.setData(
+ "import QtQuick 2.0\n"
+ "Item {\n"
+ " ListModel {\n"
+ " id: testModel\n"
+ " objectName: \"testModel\"\n"
+ " ListElement { name: \"Joe\"; age: 22 }\n"
+ " }\n"
+ "}\n", QUrl());
+ QScopedPointer<QObject> scene(component.create());
+ QQmlListModel *model = scene->findChild<QQmlListModel*>("testModel");
+ QQmlExpression expr(engine.rootContext(), model, "get(0);");
+ QVariant v = expr.evaluate();
+ QVERIFY2(!expr.hasError(), QTest::toString(expr.error().toString()));
+
+ QObject *obj = v.value<QObject*>();
+ QVERIFY(obj);
+
+ QQmlData *ddata = QQmlData::get(obj, /*create*/false);
+ QVERIFY(ddata);
+ QVERIFY(!ddata->jsWrapper.isNullOrUndefined());
+}
+
QTEST_MAIN(tst_qqmllistmodel)
#include "tst_qqmllistmodel.moc"
diff --git a/tests/auto/quick/qquickimage/data/pattern.pkm b/tests/auto/quick/qquickimage/data/pattern.pkm
new file mode 100644
index 0000000000..d986e89b2d
--- /dev/null
+++ b/tests/auto/quick/qquickimage/data/pattern.pkm
Binary files differ
diff --git a/tests/auto/quick/qquickimage/tst_qquickimage.cpp b/tests/auto/quick/qquickimage/tst_qquickimage.cpp
index f61b490307..783e4aab4c 100644
--- a/tests/auto/quick/qquickimage/tst_qquickimage.cpp
+++ b/tests/auto/quick/qquickimage/tst_qquickimage.cpp
@@ -152,6 +152,14 @@ void tst_qquickimage::imageSource_data()
QTest::newRow("remote svgz") << "/heart.svgz" << 595.0 << 841.0 << true << false << false << "";
QTest::newRow("remote not found") << "/no-such-file.png" << 0.0 << 0.0 << true
<< false << true << "<Unknown File>:2:1: QML Image: Error transferring {{ServerBaseUrl}}/no-such-file.png - server replied: Not found";
+ QTest::newRow("extless") << testFileUrl("colors").toString() << 120.0 << 120.0 << false << false << true << "";
+ QTest::newRow("extless no cache") << testFileUrl("colors").toString() << 120.0 << 120.0 << false << false << false << "";
+ QTest::newRow("extless async") << testFileUrl("colors1").toString() << 120.0 << 120.0 << false << true << true << "";
+ QTest::newRow("extless not found") << testFileUrl("no-such-file").toString() << 0.0 << 0.0 << false
+ << false << true << "<Unknown File>:2:1: QML Image: Cannot open: " + testFileUrl("no-such-file").toString();
+ // Test that pkm is preferred over png. As pattern.pkm has different size than pattern.png, these tests verify that the right file has been loaded
+ QTest::newRow("extless prefer-tex") << testFileUrl("pattern").toString() << 64.0 << 64.0 << false << false << true << "";
+ QTest::newRow("extless prefer-tex async") << testFileUrl("pattern").toString() << 64.0 << 64.0 << false << true << true << "";
}