diff options
Diffstat (limited to 'tests/auto/quick/qquickloader/data/loadedSignal.2.qml')
-rw-r--r-- | tests/auto/quick/qquickloader/data/loadedSignal.2.qml | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickloader/data/loadedSignal.2.qml b/tests/auto/quick/qquickloader/data/loadedSignal.2.qml new file mode 100644 index 0000000000..a4a663c71f --- /dev/null +++ b/tests/auto/quick/qquickloader/data/loadedSignal.2.qml @@ -0,0 +1,31 @@ +import QtQuick 2.0 + +Item { + id: root + + width: 200 + height: 200 + + property bool success: true + property int loadCount: 0 + + Loader { + id: loader + anchors.fill: parent + asynchronous: true + active: false + source: "TestComponent.qml" + onLoaded: { + if (status !== Loader.Ready) { + root.success = false; + } + root.loadCount++; + } + } + + function triggerLoading() { + // we set source to a valid path (but which is an invalid / erroneous component) + // we should not get onLoaded, since the status should not be Ready. + loader.source = "GreenRect.qml" // causes reference error. + } +} |