diff options
Diffstat (limited to 'tests/auto/declarative/qsgloader/data')
25 files changed, 223 insertions, 0 deletions
diff --git a/tests/auto/declarative/qsgloader/data/AnchoredLoader.qml b/tests/auto/declarative/qsgloader/data/AnchoredLoader.qml new file mode 100644 index 0000000000..1a2a620d7f --- /dev/null +++ b/tests/auto/declarative/qsgloader/data/AnchoredLoader.qml @@ -0,0 +1,14 @@ +import QtQuick 2.0 + +Rectangle { + width: 300 + height: 200 + color: "blue" + Loader { + objectName: "loader" + anchors.fill: parent + sourceComponent: Component { + Rectangle { color: "red"; objectName: "sourceElement" } + } + } +} diff --git a/tests/auto/declarative/qsgloader/data/BlueRect.qml b/tests/auto/declarative/qsgloader/data/BlueRect.qml new file mode 100644 index 0000000000..e96ac00f21 --- /dev/null +++ b/tests/auto/declarative/qsgloader/data/BlueRect.qml @@ -0,0 +1,8 @@ +import QtQuick 2.0 + +Rectangle { + objectName: "blue" + width: 100 + height: 100 + color: "blue" +} diff --git a/tests/auto/declarative/qsgloader/data/CreationContextLoader.qml b/tests/auto/declarative/qsgloader/data/CreationContextLoader.qml new file mode 100644 index 0000000000..4dd73e797c --- /dev/null +++ b/tests/auto/declarative/qsgloader/data/CreationContextLoader.qml @@ -0,0 +1,15 @@ +import QtQuick 2.0 + +Loader { + id: myLoader + property int testProperty: 1912 + sourceComponent: loaderComponent + Component { + id: loaderComponent + Item { + Component.onCompleted: { + test = (myLoader.testProperty == 1912); + } + } + } +} diff --git a/tests/auto/declarative/qsgloader/data/GraphicsWidget250x250.qml b/tests/auto/declarative/qsgloader/data/GraphicsWidget250x250.qml new file mode 100644 index 0000000000..dae8e3fbbb --- /dev/null +++ b/tests/auto/declarative/qsgloader/data/GraphicsWidget250x250.qml @@ -0,0 +1,5 @@ +import QtQuick 2.0 + +QGraphicsWidget { + size: "250x250" +} diff --git a/tests/auto/declarative/qsgloader/data/GreenRect.qml b/tests/auto/declarative/qsgloader/data/GreenRect.qml new file mode 100644 index 0000000000..99cefaf176 --- /dev/null +++ b/tests/auto/declarative/qsgloader/data/GreenRect.qml @@ -0,0 +1,7 @@ +import QtQuick 2.0 + +Rectangle { + width: 100; height: 100 + color: "green" + Component.onCompleted: myLoader.source = "BlueRect.qml" +} diff --git a/tests/auto/declarative/qsgloader/data/NoResize.qml b/tests/auto/declarative/qsgloader/data/NoResize.qml new file mode 100644 index 0000000000..9b3ea6410b --- /dev/null +++ b/tests/auto/declarative/qsgloader/data/NoResize.qml @@ -0,0 +1,8 @@ +import QtQuick 2.0 + +Item { + width: 200; height: 80 + Loader { + source: "Rect120x60.qml" + } +} diff --git a/tests/auto/declarative/qsgloader/data/NoResizeGraphicsWidget.qml b/tests/auto/declarative/qsgloader/data/NoResizeGraphicsWidget.qml new file mode 100644 index 0000000000..c0f51d8c35 --- /dev/null +++ b/tests/auto/declarative/qsgloader/data/NoResizeGraphicsWidget.qml @@ -0,0 +1,9 @@ +import QtQuick 2.0 + +Item { + width: 200 + height: 80 + Loader { + source: "GraphicsWidget250x250.qml" + } +} diff --git a/tests/auto/declarative/qsgloader/data/QTBUG_16928.qml b/tests/auto/declarative/qsgloader/data/QTBUG_16928.qml new file mode 100644 index 0000000000..903d7f0812 --- /dev/null +++ b/tests/auto/declarative/qsgloader/data/QTBUG_16928.qml @@ -0,0 +1,23 @@ +import QtQuick 2.0 + +Rectangle { + color: "green" + width: loader.implicitWidth+50 + height: loader.implicitHeight+50 + + Loader { + id: loader + sourceComponent: Item { + anchors.centerIn: parent + + implicitWidth: 200 + implicitHeight: 200 + Rectangle { + color: "red" + anchors.fill: parent + } + } + anchors.fill: parent + anchors.margins: 15 + } +} diff --git a/tests/auto/declarative/qsgloader/data/QTBUG_17114.qml b/tests/auto/declarative/qsgloader/data/QTBUG_17114.qml new file mode 100644 index 0000000000..7402037553 --- /dev/null +++ b/tests/auto/declarative/qsgloader/data/QTBUG_17114.qml @@ -0,0 +1,18 @@ +import QtQuick 2.0 + +Rectangle { + property real loaderWidth: loader.width + property real loaderHeight: loader.height + width: 200 + height: 200 + + Loader { + id: loader + sourceComponent: Item { + property real iwidth: 32 + property real iheight: 32 + width: iwidth + height: iheight + } + } +} diff --git a/tests/auto/declarative/qsgloader/data/Rect120x60.qml b/tests/auto/declarative/qsgloader/data/Rect120x60.qml new file mode 100644 index 0000000000..fc9e447e69 --- /dev/null +++ b/tests/auto/declarative/qsgloader/data/Rect120x60.qml @@ -0,0 +1,6 @@ +import QtQuick 2.0 + +Rectangle { + width: 120 + height:60 +} diff --git a/tests/auto/declarative/qsgloader/data/SetSourceComponent.qml b/tests/auto/declarative/qsgloader/data/SetSourceComponent.qml new file mode 100644 index 0000000000..83cc358f7d --- /dev/null +++ b/tests/auto/declarative/qsgloader/data/SetSourceComponent.qml @@ -0,0 +1,9 @@ +import QtQuick 2.0 + +Item { + function clear() { + loader.sourceComponent = undefined + } + Component { id: comp; Rectangle { width: 100; height: 50 } } + Loader { id: loader; sourceComponent: comp } +} diff --git a/tests/auto/declarative/qsgloader/data/SizeGraphicsWidgetToLoader.qml b/tests/auto/declarative/qsgloader/data/SizeGraphicsWidgetToLoader.qml new file mode 100644 index 0000000000..2a63b4d34f --- /dev/null +++ b/tests/auto/declarative/qsgloader/data/SizeGraphicsWidgetToLoader.qml @@ -0,0 +1,7 @@ +import QtQuick 2.0 + +Loader { + width: 200 + height: 80 + source: "GraphicsWidget250x250.qml" +} diff --git a/tests/auto/declarative/qsgloader/data/SizeLoaderToGraphicsWidget.qml b/tests/auto/declarative/qsgloader/data/SizeLoaderToGraphicsWidget.qml new file mode 100644 index 0000000000..a9875d8e21 --- /dev/null +++ b/tests/auto/declarative/qsgloader/data/SizeLoaderToGraphicsWidget.qml @@ -0,0 +1,5 @@ +import QtQuick 2.0 + +Loader { + source: "GraphicsWidget250x250.qml" +} diff --git a/tests/auto/declarative/qsgloader/data/SizeToItem.qml b/tests/auto/declarative/qsgloader/data/SizeToItem.qml new file mode 100644 index 0000000000..866365754f --- /dev/null +++ b/tests/auto/declarative/qsgloader/data/SizeToItem.qml @@ -0,0 +1,5 @@ +import QtQuick 2.0 + +Loader { + source: "Rect120x60.qml" +} diff --git a/tests/auto/declarative/qsgloader/data/SizeToLoader.qml b/tests/auto/declarative/qsgloader/data/SizeToLoader.qml new file mode 100644 index 0000000000..dad18c6939 --- /dev/null +++ b/tests/auto/declarative/qsgloader/data/SizeToLoader.qml @@ -0,0 +1,6 @@ +import QtQuick 2.0 + +Loader { + width: 200; height: 80 + source: "Rect120x60.qml" +} diff --git a/tests/auto/declarative/qsgloader/data/VmeError.qml b/tests/auto/declarative/qsgloader/data/VmeError.qml new file mode 100644 index 0000000000..0443aa9054 --- /dev/null +++ b/tests/auto/declarative/qsgloader/data/VmeError.qml @@ -0,0 +1,7 @@ +import QtQuick 2.0 + +Rectangle { + width: 100; height: 100; color: "red" + signal somethingHappened + onSomethingHappened: QtObject {} +} diff --git a/tests/auto/declarative/qsgloader/data/crash.qml b/tests/auto/declarative/qsgloader/data/crash.qml new file mode 100644 index 0000000000..e6ddc33a10 --- /dev/null +++ b/tests/auto/declarative/qsgloader/data/crash.qml @@ -0,0 +1,14 @@ +import QtQuick 2.0 + +Rectangle { + width: 400 + height: 400 + + function setLoaderSource() { + myLoader.source = "GreenRect.qml" + } + + Loader { + id: myLoader + } +} diff --git a/tests/auto/declarative/qsgloader/data/creationContext.qml b/tests/auto/declarative/qsgloader/data/creationContext.qml new file mode 100644 index 0000000000..17a596cc74 --- /dev/null +++ b/tests/auto/declarative/qsgloader/data/creationContext.qml @@ -0,0 +1,8 @@ +import QtQuick 2.0 + +Item { + property bool test: false + + CreationContextLoader { + } +} diff --git a/tests/auto/declarative/qsgloader/data/differentorigin.qml b/tests/auto/declarative/qsgloader/data/differentorigin.qml new file mode 100644 index 0000000000..56a3034fe0 --- /dev/null +++ b/tests/auto/declarative/qsgloader/data/differentorigin.qml @@ -0,0 +1,3 @@ +import QtQuick 2.0 + +Loader { source: "http://evil.place/evil.qml" } diff --git a/tests/auto/declarative/qsgloader/data/implicitSize.qml b/tests/auto/declarative/qsgloader/data/implicitSize.qml new file mode 100644 index 0000000000..5c8c8348ed --- /dev/null +++ b/tests/auto/declarative/qsgloader/data/implicitSize.qml @@ -0,0 +1,28 @@ +import QtQuick 2.0 + +Rectangle { + property real implWidth: 0 + property real implHeight: 0 + color: "green" + width: loader.implicitWidth+50 + height: loader.implicitHeight+50 + + Loader { + id: loader + sourceComponent: Item { + anchors.centerIn: parent + + implicitWidth: 100 + implicitHeight: 100 + Rectangle { + color: "red" + anchors.fill: parent + } + } + + anchors.fill: parent + anchors.margins: 50 + onImplicitWidthChanged: implWidth = implicitWidth + onImplicitHeightChanged: implHeight = loader.implicitHeight + } +} diff --git a/tests/auto/declarative/qsgloader/data/nonItem.qml b/tests/auto/declarative/qsgloader/data/nonItem.qml new file mode 100644 index 0000000000..8cfa0d8efb --- /dev/null +++ b/tests/auto/declarative/qsgloader/data/nonItem.qml @@ -0,0 +1,5 @@ +import QtQuick 2.0 + +Loader { + sourceComponent: QtObject {} +} diff --git a/tests/auto/declarative/qsgloader/data/qmldir b/tests/auto/declarative/qsgloader/data/qmldir new file mode 100644 index 0000000000..bf42b507c0 --- /dev/null +++ b/tests/auto/declarative/qsgloader/data/qmldir @@ -0,0 +1 @@ +# For tst_QDeclarativeLoader::networkRequestUrl; no types needed though. diff --git a/tests/auto/declarative/qsgloader/data/sameorigin-load.qml b/tests/auto/declarative/qsgloader/data/sameorigin-load.qml new file mode 100644 index 0000000000..3332500be6 --- /dev/null +++ b/tests/auto/declarative/qsgloader/data/sameorigin-load.qml @@ -0,0 +1,3 @@ +import QtQuick 2.0 + +Item { } diff --git a/tests/auto/declarative/qsgloader/data/sameorigin.qml b/tests/auto/declarative/qsgloader/data/sameorigin.qml new file mode 100644 index 0000000000..84846b6aba --- /dev/null +++ b/tests/auto/declarative/qsgloader/data/sameorigin.qml @@ -0,0 +1,3 @@ +import QtQuick 2.0 + +Loader { source: "sameorigin-load.qml" } diff --git a/tests/auto/declarative/qsgloader/data/vmeErrors.qml b/tests/auto/declarative/qsgloader/data/vmeErrors.qml new file mode 100644 index 0000000000..8e6c89dc8e --- /dev/null +++ b/tests/auto/declarative/qsgloader/data/vmeErrors.qml @@ -0,0 +1,6 @@ +import QtQuick 2.0 + +Loader { + source: "VmeError.qml" +} + |