tst_qquickloader: Test setting source from component works
Not verifying this works before has caused regressions. Change-Id: I4b99928bb6993d511349aec782660d24a134f67d Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This commit is contained in:
parent
f84282dad7
commit
92aeac07fa
|
@ -0,0 +1,3 @@
|
|||
import QtQuick
|
||||
|
||||
Item {}
|
|
@ -0,0 +1,5 @@
|
|||
import QtQuick
|
||||
|
||||
Item {
|
||||
Component.onCompleted: { loader.setSource("empty.qml"); }
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
import QtQuick
|
||||
|
||||
Loader {
|
||||
id: loader
|
||||
source: "loaderSelfSource.qml"
|
||||
}
|
|
@ -114,6 +114,7 @@ private slots:
|
|||
void asyncToSync1();
|
||||
void asyncToSync2();
|
||||
void loadedSignal();
|
||||
void selfSetSource();
|
||||
|
||||
void parented();
|
||||
void sizeBound();
|
||||
|
@ -1142,6 +1143,17 @@ void tst_QQuickLoader::loadedSignal()
|
|||
}
|
||||
}
|
||||
|
||||
void tst_QQuickLoader::selfSetSource()
|
||||
{
|
||||
QQmlEngine engine;
|
||||
QQmlComponent component(&engine, testFileUrl("selfSetSourceTest.qml"));
|
||||
|
||||
QScopedPointer<QObject> obj(component.create());
|
||||
QVERIFY(obj);
|
||||
|
||||
QTRY_COMPARE(obj->property("source").toUrl(), testFileUrl("empty.qml"));
|
||||
}
|
||||
|
||||
void tst_QQuickLoader::parented()
|
||||
{
|
||||
QQmlEngine engine;
|
||||
|
|
Loading…
Reference in New Issue