diff options
author | Lars Knoll <lars.knoll@nokia.com> | 2012-04-11 14:56:22 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@nokia.com> | 2012-04-11 16:05:03 +0200 |
commit | a896d4b39ec3d45ba708d9b36ea9c864b1df2136 (patch) | |
tree | 45cfe153cce6114c2c76c48dc0bdabde2a8cf3e3 /tests/auto/quick/qquickloader/data | |
parent | 24fb8dc27eddfdd62bd2c3a6e863cbf433762cd6 (diff) | |
parent | 65bfc35429e845cf6b76d58107360a1360a654fc (diff) |
Merge remote-tracking branch 'origin/master' into api_changes
Conflicts:
src/qml/debugger/qqmlprofilerservice_p.h
src/qml/qml/qqmlboundsignal.cpp
src/qml/qml/v4/qv4bindings.cpp
src/quick/items/qquickshadereffect.cpp
src/quick/particles/qquickcustomparticle.cpp
src/quick/qtquick2.cpp
Change-Id: Ia9c6517035ae912fa75e77473a452bd3383def56
Diffstat (limited to 'tests/auto/quick/qquickloader/data')
4 files changed, 92 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickloader/data/RedRect.qml b/tests/auto/quick/qquickloader/data/RedRect.qml new file mode 100644 index 0000000000..0eec9b56b7 --- /dev/null +++ b/tests/auto/quick/qquickloader/data/RedRect.qml @@ -0,0 +1,8 @@ +import QtQuick 2.0 + +Rectangle { + objectName: "red" + width: 100 + height: 100 + color: "red" +} diff --git a/tests/auto/quick/qquickloader/data/implicitSize.qml b/tests/auto/quick/qquickloader/data/implicitSize.qml index 5c8c8348ed..ae8c0b8b30 100644 --- a/tests/auto/quick/qquickloader/data/implicitSize.qml +++ b/tests/auto/quick/qquickloader/data/implicitSize.qml @@ -3,12 +3,17 @@ import QtQuick 2.0 Rectangle { property real implWidth: 0 property real implHeight: 0 + function changeImplicitSize () { + loader.item.implicitWidth = 200 + loader.item.implicitHeight = 300 + } color: "green" width: loader.implicitWidth+50 height: loader.implicitHeight+50 Loader { id: loader + objectName: "loader" sourceComponent: Item { anchors.centerIn: parent 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. + } +} diff --git a/tests/auto/quick/qquickloader/data/loadedSignal.qml b/tests/auto/quick/qquickloader/data/loadedSignal.qml new file mode 100644 index 0000000000..7cc0fed001 --- /dev/null +++ b/tests/auto/quick/qquickloader/data/loadedSignal.qml @@ -0,0 +1,48 @@ +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 active to true, which triggers loading. + // we then immediately set active to false. + // this should clear the incubator and stop loading. + loader.active = true; + loader.active = false; + } + + function activate() { + loader.active = true; + } + + function deactivate() { + loader.active = false; + } + + function triggerMultipleLoad() { + loader.active = false; // deactivate as a precondition. + loader.source = "BlueRect.qml" + loader.active = true; // should trigger loading to begin + loader.source = "RedRect.qml"; // should clear the incubator and restart loading + } +} |