diff options
Diffstat (limited to 'tests/auto/qtquick1/qdeclarativepositioners/data')
17 files changed, 635 insertions, 0 deletions
diff --git a/tests/auto/qtquick1/qdeclarativepositioners/data/flow-testimplicitsize.qml b/tests/auto/qtquick1/qdeclarativepositioners/data/flow-testimplicitsize.qml new file mode 100644 index 0000000000..ee4e1048a2 --- /dev/null +++ b/tests/auto/qtquick1/qdeclarativepositioners/data/flow-testimplicitsize.qml @@ -0,0 +1,19 @@ +import QtQuick 1.1 + +Rectangle { + width: 300; height: 200; + + property int flowLayout: 1 + + Flow { + objectName: "flow" + layoutDirection: (flowLayout == 2) ? Qt.RightToLeft : Qt.LeftToRight + flow: (flowLayout == 1) ? Flow.TopToBottom : Flow.LeftToRight; + + spacing: 20 + anchors.horizontalCenter: parent.horizontalCenter + Rectangle { color: "red"; width: 100; height: 50 } + Rectangle { color: "blue"; width: 100; height: 50 } + } +} + diff --git a/tests/auto/qtquick1/qdeclarativepositioners/data/flowtest-toptobottom.qml b/tests/auto/qtquick1/qdeclarativepositioners/data/flowtest-toptobottom.qml new file mode 100644 index 0000000000..ec1d6660c3 --- /dev/null +++ b/tests/auto/qtquick1/qdeclarativepositioners/data/flowtest-toptobottom.qml @@ -0,0 +1,44 @@ +import QtQuick 1.1 + +Item { + height: 90 + width: 480 + property bool testRightToLeft: false + + Flow { + objectName: "flow" + height: parent.height + layoutDirection: testRightToLeft ? Qt.RightToLeft : Qt.LeftToRight + flow: Flow.TopToBottom + Rectangle { + objectName: "one" + color: "red" + width: 50 + height: 50 + } + Rectangle { + objectName: "two" + color: "green" + width: 20 + height: 50 + } + Rectangle { + objectName: "three" + color: "blue" + width: 50 + height: 20 + } + Rectangle { + objectName: "four" + color: "cyan" + width: 50 + height: 50 + } + Rectangle { + objectName: "five" + color: "magenta" + width: 10 + height: 10 + } + } +} diff --git a/tests/auto/qtquick1/qdeclarativepositioners/data/flowtest.qml b/tests/auto/qtquick1/qdeclarativepositioners/data/flowtest.qml new file mode 100644 index 0000000000..7c124a3d44 --- /dev/null +++ b/tests/auto/qtquick1/qdeclarativepositioners/data/flowtest.qml @@ -0,0 +1,43 @@ +import QtQuick 1.1 + +Item { + width: 90 + height: 480 + property bool testRightToLeft: false + + Flow { + objectName: "flow" + width: parent.width + layoutDirection: testRightToLeft ? Qt.RightToLeft : Qt.LeftToRight + Rectangle { + objectName: "one" + color: "red" + width: 50 + height: 50 + } + Rectangle { + objectName: "two" + color: "green" + width: 20 + height: 50 + } + Rectangle { + objectName: "three" + color: "blue" + width: 50 + height: 20 + } + Rectangle { + objectName: "four" + color: "cyan" + width: 50 + height: 50 + } + Rectangle { + objectName: "five" + color: "magenta" + width: 10 + height: 10 + } + } +} diff --git a/tests/auto/qtquick1/qdeclarativepositioners/data/grid-animated.qml b/tests/auto/qtquick1/qdeclarativepositioners/data/grid-animated.qml new file mode 100644 index 0000000000..3dcbed1103 --- /dev/null +++ b/tests/auto/qtquick1/qdeclarativepositioners/data/grid-animated.qml @@ -0,0 +1,64 @@ +import QtQuick 1.1 + +Item { + width: 640 + height: 480 + property bool testRightToLeft: true + + Grid { + objectName: "grid" + columns: 3 + layoutDirection: testRightToLeft ? Qt.RightToLeft : Qt.LeftToRight + add: Transition { + NumberAnimation { + properties: "x,y"; + } + } + move: Transition { + NumberAnimation { + properties: "x,y"; + } + } + Rectangle { + objectName: "one" + color: "red" + x: -100 + y: -100 + width: 50 + height: 50 + } + Rectangle { + objectName: "two" + x: -100 + y: -100 + opacity: 0 + color: "green" + width: 50 + height: 50 + } + Rectangle { + objectName: "three" + color: "blue" + x: -100 + y: -100 + width: 50 + height: 50 + } + Rectangle { + objectName: "four" + color: "cyan" + x: -100 + y: -100 + width: 50 + height: 50 + } + Rectangle { + objectName: "five" + color: "magenta" + x: -100 + y: -100 + width: 50 + height: 50 + } + } +} diff --git a/tests/auto/qtquick1/qdeclarativepositioners/data/grid-spacing.qml b/tests/auto/qtquick1/qdeclarativepositioners/data/grid-spacing.qml new file mode 100644 index 0000000000..f03733001b --- /dev/null +++ b/tests/auto/qtquick1/qdeclarativepositioners/data/grid-spacing.qml @@ -0,0 +1,41 @@ +import QtQuick 1.0 + +Item { + width: 640 + height: 480 + Grid { + objectName: "grid" + columns: 3 + spacing: 4 + Rectangle { + objectName: "one" + color: "red" + width: 50 + height: 50 + } + Rectangle { + objectName: "two" + color: "green" + width: 20 + height: 50 + } + Rectangle { + objectName: "three" + color: "blue" + width: 50 + height: 20 + } + Rectangle { + objectName: "four" + color: "cyan" + width: 50 + height: 50 + } + Rectangle { + objectName: "five" + color: "magenta" + width: 10 + height: 10 + } + } +} diff --git a/tests/auto/qtquick1/qdeclarativepositioners/data/grid-toptobottom.qml b/tests/auto/qtquick1/qdeclarativepositioners/data/grid-toptobottom.qml new file mode 100644 index 0000000000..5d4c3373e5 --- /dev/null +++ b/tests/auto/qtquick1/qdeclarativepositioners/data/grid-toptobottom.qml @@ -0,0 +1,41 @@ +import QtQuick 1.0 + +Item { + width: 640 + height: 480 + Grid { + objectName: "grid" + rows: 3 + flow: Grid.TopToBottom + Rectangle { + objectName: "one" + color: "red" + width: 50 + height: 50 + } + Rectangle { + objectName: "two" + color: "green" + width: 20 + height: 50 + } + Rectangle { + objectName: "three" + color: "blue" + width: 50 + height: 20 + } + Rectangle { + objectName: "four" + color: "cyan" + width: 50 + height: 50 + } + Rectangle { + objectName: "five" + color: "magenta" + width: 10 + height: 10 + } + } +} diff --git a/tests/auto/qtquick1/qdeclarativepositioners/data/gridtest.qml b/tests/auto/qtquick1/qdeclarativepositioners/data/gridtest.qml new file mode 100644 index 0000000000..929b7267cf --- /dev/null +++ b/tests/auto/qtquick1/qdeclarativepositioners/data/gridtest.qml @@ -0,0 +1,42 @@ +import QtQuick 1.1 + +Item { + width: 640 + height: 480 + property bool testRightToLeft: false + Grid { + layoutDirection: testRightToLeft ? Qt.RightToLeft : Qt.LeftToRight + objectName: "grid" + columns: 3 + Rectangle { + objectName: "one" + color: "red" + width: 50 + height: 50 + } + Rectangle { + objectName: "two" + color: "green" + width: 20 + height: 50 + } + Rectangle { + objectName: "three" + color: "blue" + width: 30 + height: 20 + } + Rectangle { + objectName: "four" + color: "cyan" + width: 50 + height: 50 + } + Rectangle { + objectName: "five" + color: "magenta" + width: 10 + height: 10 + } + } +} diff --git a/tests/auto/qtquick1/qdeclarativepositioners/data/gridzerocolumns.qml b/tests/auto/qtquick1/qdeclarativepositioners/data/gridzerocolumns.qml new file mode 100644 index 0000000000..169f974477 --- /dev/null +++ b/tests/auto/qtquick1/qdeclarativepositioners/data/gridzerocolumns.qml @@ -0,0 +1,40 @@ +import QtQuick 1.0 + +Item { + width: 640 + height: 480 + Grid { + objectName: "grid" + columns: 0 + Rectangle { + objectName: "one" + color: "red" + width: 50 + height: 50 + } + Rectangle { + objectName: "two" + color: "green" + width: 20 + height: 50 + } + Rectangle { + objectName: "three" + color: "blue" + width: 50 + height: 20 + } + Rectangle { + objectName: "four" + color: "cyan" + width: 50 + height: 50 + } + Rectangle { + objectName: "five" + color: "magenta" + width: 10 + height: 10 + } + } +} diff --git a/tests/auto/qtquick1/qdeclarativepositioners/data/horizontal-animated.qml b/tests/auto/qtquick1/qdeclarativepositioners/data/horizontal-animated.qml new file mode 100644 index 0000000000..3c95f53fe7 --- /dev/null +++ b/tests/auto/qtquick1/qdeclarativepositioners/data/horizontal-animated.qml @@ -0,0 +1,44 @@ +import QtQuick 1.1 + +Item { + width: 640 + height: 480 + property bool testRightToLeft: false + + Row { + objectName: "row" + layoutDirection: testRightToLeft ? Qt.RightToLeft : Qt.LeftToRight + add: Transition { + NumberAnimation { + properties: "x"; + } + } + move: Transition { + NumberAnimation { + properties: "x"; + } + } + Rectangle { + objectName: "one" + color: "red" + x: -100; + width: 50 + height: 50 + } + Rectangle { + objectName: "two" + color: "blue" + x: -100; + opacity: 0 + width: 50 + height: 50 + } + Rectangle { + objectName: "three" + x: -100; + color: "green" + width: 50 + height: 50 + } + } +} diff --git a/tests/auto/qtquick1/qdeclarativepositioners/data/horizontal-spacing.qml b/tests/auto/qtquick1/qdeclarativepositioners/data/horizontal-spacing.qml new file mode 100644 index 0000000000..64bedb02d3 --- /dev/null +++ b/tests/auto/qtquick1/qdeclarativepositioners/data/horizontal-spacing.qml @@ -0,0 +1,31 @@ +import QtQuick 1.1 + +Item { + width: 640 + height: 480 + property bool testRightToLeft: false + + Row { + objectName: "row" + spacing: 10 + layoutDirection: testRightToLeft ? Qt.RightToLeft : Qt.LeftToRight + Rectangle { + objectName: "one" + color: "red" + width: 50 + height: 50 + } + Rectangle { + objectName: "two" + color: "red" + width: 20 + height: 10 + } + Rectangle { + objectName: "three" + color: "red" + width: 40 + height: 20 + } + } +} diff --git a/tests/auto/qtquick1/qdeclarativepositioners/data/horizontal.qml b/tests/auto/qtquick1/qdeclarativepositioners/data/horizontal.qml new file mode 100644 index 0000000000..d35c02d538 --- /dev/null +++ b/tests/auto/qtquick1/qdeclarativepositioners/data/horizontal.qml @@ -0,0 +1,29 @@ +import QtQuick 1.1 + +Item { + width: 640 + height: 480 + property bool testRightToLeft: false + Row { + objectName: "row" + layoutDirection: testRightToLeft ? Qt.RightToLeft : Qt.LeftToRight + Rectangle { + objectName: "one" + color: "red" + width: 50 + height: 50 + } + Rectangle { + objectName: "two" + color: "red" + width: 20 + height: 10 + } + Rectangle { + objectName: "three" + color: "red" + width: 40 + height: 20 + } + } +} diff --git a/tests/auto/qtquick1/qdeclarativepositioners/data/propertychangestest.qml b/tests/auto/qtquick1/qdeclarativepositioners/data/propertychangestest.qml new file mode 100644 index 0000000000..3c95c4c279 --- /dev/null +++ b/tests/auto/qtquick1/qdeclarativepositioners/data/propertychangestest.qml @@ -0,0 +1,39 @@ +import QtQuick 1.0 + +Grid { + id: myGrid + + width: 270 + height: 270 + x: 3 + y: 3 + columns: 4 + spacing: 3 + + add: columnTransition + move: columnTransition + + Repeater { + model: 20 + Rectangle { color: "black"; width: 50; height: 50 } + } + + data: [ + Transition { + id: rowTransition + objectName: "rowTransition" + NumberAnimation { + properties: "x,y"; + easing.type: "OutInCubic" + } + }, + Transition { + id: columnTransition + objectName: "columnTransition" + NumberAnimation { + properties: "x,y"; + easing.type: "OutInCubic" + } + } + ] +} diff --git a/tests/auto/qtquick1/qdeclarativepositioners/data/repeatertest.qml b/tests/auto/qtquick1/qdeclarativepositioners/data/repeatertest.qml new file mode 100644 index 0000000000..f93ce67da3 --- /dev/null +++ b/tests/auto/qtquick1/qdeclarativepositioners/data/repeatertest.qml @@ -0,0 +1,38 @@ +import QtQuick 1.0 + +Item { + width: 640 + height: 480 + Row { + Repeater{ model: 3; + delegate: Component { + Rectangle { + color: "red" + width: 50 + height: 50 + z: {if(index == 0){2;}else if(index == 1){1;} else{3;}} + objectName: {if(index == 0){"one";}else if(index == 1){"two";} else{"three";}} + } + } + } + } + + //This crashed once (QTBUG-16959) because the repeater ended up on the end of the list + //If this grid just instantiates without crashing, then it has not regressed. + Grid { + id: grid + rows: 2 + flow: Grid.TopToBottom + + Repeater { + model: 13 + Rectangle { + color: "goldenrod" + width: 100 + height: 100 + radius: 10 + border.width: 1 + } + } + } +} diff --git a/tests/auto/qtquick1/qdeclarativepositioners/data/vertical-animated.qml b/tests/auto/qtquick1/qdeclarativepositioners/data/vertical-animated.qml new file mode 100644 index 0000000000..8899ac83cc --- /dev/null +++ b/tests/auto/qtquick1/qdeclarativepositioners/data/vertical-animated.qml @@ -0,0 +1,41 @@ +import QtQuick 1.0 + +Item { + width: 640 + height: 480 + Column { + objectName: "column" + add: Transition { + NumberAnimation { + properties: "y"; + } + } + move: Transition { + NumberAnimation { + properties: "y"; + } + } + Rectangle { + objectName: "one" + color: "red" + y: -100 + width: 50 + height: 50 + } + Rectangle { + objectName: "two" + color: "blue" + y: -100 + opacity: 0 + width: 50 + height: 50 + } + Rectangle { + objectName: "three" + color: "red" + y: -100 + width: 50 + height: 50 + } + } +} diff --git a/tests/auto/qtquick1/qdeclarativepositioners/data/vertical-spacing.qml b/tests/auto/qtquick1/qdeclarativepositioners/data/vertical-spacing.qml new file mode 100644 index 0000000000..557896115d --- /dev/null +++ b/tests/auto/qtquick1/qdeclarativepositioners/data/vertical-spacing.qml @@ -0,0 +1,28 @@ +import QtQuick 1.0 + +Item { + width: 640 + height: 480 + Column { + objectName: "column" + spacing: 10 + Rectangle { + objectName: "one" + color: "red" + width: 50 + height: 50 + } + Rectangle { + objectName: "two" + color: "red" + width: 20 + height: 10 + } + Rectangle { + objectName: "three" + color: "red" + width: 40 + height: 20 + } + } +} diff --git a/tests/auto/qtquick1/qdeclarativepositioners/data/vertical.qml b/tests/auto/qtquick1/qdeclarativepositioners/data/vertical.qml new file mode 100644 index 0000000000..310d791d55 --- /dev/null +++ b/tests/auto/qtquick1/qdeclarativepositioners/data/vertical.qml @@ -0,0 +1,27 @@ +import QtQuick 1.0 + +Item { + width: 640 + height: 480 + Column { + objectName: "column" + Rectangle { + objectName: "one" + color: "red" + width: 50 + height: 50 + } + Rectangle { + objectName: "two" + color: "red" + width: 20 + height: 10 + } + Rectangle { + objectName: "three" + color: "red" + width: 40 + height: 20 + } + } +} diff --git a/tests/auto/qtquick1/qdeclarativepositioners/data/verticalqgraphicswidget.qml b/tests/auto/qtquick1/qdeclarativepositioners/data/verticalqgraphicswidget.qml new file mode 100644 index 0000000000..c320714f15 --- /dev/null +++ b/tests/auto/qtquick1/qdeclarativepositioners/data/verticalqgraphicswidget.qml @@ -0,0 +1,24 @@ +import QtQuick 1.0 + +Item { + width: 640 + height: 480 + Column { + objectName: "column" + QGraphicsWidget { + objectName: "one" + width: 50 + height: 50 + } + QGraphicsWidget { + objectName: "two" + width: 20 + height: 10 + } + QGraphicsWidget { + objectName: "three" + width: 40 + height: 20 + } + } +} |