diff options
Diffstat (limited to 'tests/auto/qtquick2/qquicklistview/data')
39 files changed, 0 insertions, 2272 deletions
diff --git a/tests/auto/qtquick2/qquicklistview/data/ComponentView.qml b/tests/auto/qtquick2/qquicklistview/data/ComponentView.qml deleted file mode 100644 index 3e87be8799..0000000000 --- a/tests/auto/qtquick2/qquicklistview/data/ComponentView.qml +++ /dev/null @@ -1,16 +0,0 @@ -import QtQuick 2.0 - -ListView { - id: view - - property string title - - width: 100; height: 100; - - model: 1 - delegate: Text { objectName: "listItem"; text: view.title } - header: Text { objectName: "header"; text: view.title } - footer: Text { objectName: "footer"; text: view.title } - section.delegate: Text { objectName: "section"; text: view.title } - section.property: "modelData" -} diff --git a/tests/auto/qtquick2/qquicklistview/data/Page.qml b/tests/auto/qtquick2/qquicklistview/data/Page.qml deleted file mode 100644 index abe4364315..0000000000 --- a/tests/auto/qtquick2/qquicklistview/data/Page.qml +++ /dev/null @@ -1,10 +0,0 @@ -import QtQuick 2.0 - -Item { - anchors.fill: parent - default property alias contentArea: contentItem.data - Item { - id: contentItem - anchors.fill: parent - } -} diff --git a/tests/auto/qtquick2/qquicklistview/data/addTransitions.qml b/tests/auto/qtquick2/qquicklistview/data/addTransitions.qml deleted file mode 100644 index ff90ead8a6..0000000000 --- a/tests/auto/qtquick2/qquicklistview/data/addTransitions.qml +++ /dev/null @@ -1,134 +0,0 @@ -import QtQuick 2.0 - -Rectangle { - id: root - width: 500 - height: 600 - - property int duration: 10 - property int count: list.count - - Component { - id: myDelegate - Rectangle { - id: wrapper - - property string nameData: name - - objectName: "wrapper" - height: 20 - width: 240 - Text { text: index } - Text { - x: 30 - id: textName - objectName: "textName" - text: name - } - Text { - x: 200 - text: wrapper.y - } - color: ListView.isCurrentItem ? "lightsteelblue" : "white" - - onXChanged: checkPos() - onYChanged: checkPos() - - function checkPos() { - if (Qt.point(x, y) == targetItems_transitionFrom) - model_targetItems_transitionFrom.addItem(name, "") - if (Qt.point(x, y) == displacedItems_transitionVia) - model_displacedItems_transitionVia.addItem(name, "") - } - } - } - - ListView { - id: list - - property int targetTransitionsDone - property int displaceTransitionsDone - - property var targetTrans_items: new Object() - property var targetTrans_targetIndexes: new Array() - property var targetTrans_targetItems: new Array() - - property var displacedTrans_items: new Object() - property var displacedTrans_targetIndexes: new Array() - property var displacedTrans_targetItems: new Array() - - objectName: "list" - focus: true - anchors.centerIn: parent - width: 240 - height: 320 - model: testModel - delegate: myDelegate - - // for QDeclarativeListProperty types - function copyList(propList) { - var temp = new Array() - for (var i=0; i<propList.length; i++) - temp.push(propList[i]) - return temp - } - - add: Transition { - id: targetTransition - - SequentialAnimation { - ScriptAction { - script: { - list.targetTrans_items[targetTransition.ViewTransition.item.nameData] = targetTransition.ViewTransition.index - list.targetTrans_targetIndexes.push(targetTransition.ViewTransition.targetIndexes) - list.targetTrans_targetItems.push(list.copyList(targetTransition.ViewTransition.targetItems)) - } - } - ParallelAnimation { - NumberAnimation { properties: "x"; from: targetItems_transitionFrom.x; duration: root.duration } - NumberAnimation { properties: "y"; from: targetItems_transitionFrom.y; duration: root.duration } - } - - ScriptAction { script: list.targetTransitionsDone += 1 } - } - } - - addDisplaced: Transition { - id: displaced - - SequentialAnimation { - ScriptAction { - script: { - list.displacedTrans_items[displaced.ViewTransition.item.nameData] = displaced.ViewTransition.index - list.displacedTrans_targetIndexes.push(displaced.ViewTransition.targetIndexes) - list.displacedTrans_targetItems.push(list.copyList(displaced.ViewTransition.targetItems)) - } - } - ParallelAnimation { - NumberAnimation { properties: "x"; duration: root.duration; to: displacedItems_transitionVia.x } - NumberAnimation { properties: "y"; duration: root.duration; to: displacedItems_transitionVia.y } - } - NumberAnimation { properties: "x,y"; duration: root.duration } - - ScriptAction { script: list.displaceTransitionsDone += 1 } - } - - } - } - - Rectangle { - anchors.fill: list - color: "lightsteelblue" - opacity: 0.2 - } - - // XXX will it pass without these if I just wait for polish? - // check all of these tests - if not, then mark this bit with the bug number! - Rectangle { - anchors.bottom: parent.bottom - width: 20; height: 20 - color: "white" - NumberAnimation on x { loops: Animation.Infinite; from: 0; to: 300; duration: 100000 } - } -} - diff --git a/tests/auto/qtquick2/qquicklistview/data/asyncloader.qml b/tests/auto/qtquick2/qquicklistview/data/asyncloader.qml deleted file mode 100644 index f038f0960c..0000000000 --- a/tests/auto/qtquick2/qquicklistview/data/asyncloader.qml +++ /dev/null @@ -1,36 +0,0 @@ - -import QtQuick 2.0 - -Rectangle { - id: root - width: 300; height: 400 - color: "#2200FF00" - - Loader { - asynchronous: true - sourceComponent: viewComp - anchors.fill: parent - } - - Component { - id: viewComp - ListView { - objectName: "view" - width: 300; height: 400 - model: 20 - delegate: aDelegate - - highlight: Rectangle { color: "lightsteelblue" } - } - } - // The delegate for each list - Component { - id: aDelegate - Item { - objectName: "wrapper" - width: 300 - height: 50 - Text { text: 'Index: ' + index } - } - } -} diff --git a/tests/auto/qtquick2/qquicklistview/data/attachedSignals.qml b/tests/auto/qtquick2/qquicklistview/data/attachedSignals.qml deleted file mode 100644 index 2c3c0bbada..0000000000 --- a/tests/auto/qtquick2/qquicklistview/data/attachedSignals.qml +++ /dev/null @@ -1,24 +0,0 @@ -import QtQuick 2.0 - -ListView { - id: view - width: 240; height: 320 - - property variant addedDelegates: [] - property int removedDelegateCount - - model: testModel - - delegate: Rectangle { - width: 200; height: delegateHeight - border.width: 1 - ListView.onAdd: { - var obj = ListView.view.addedDelegates - obj.push(model.name) - ListView.view.addedDelegates = obj - } - ListView.onRemove: { - view.removedDelegateCount += 1 - } - } -} diff --git a/tests/auto/qtquick2/qquicklistview/data/creationContext.qml b/tests/auto/qtquick2/qquicklistview/data/creationContext.qml deleted file mode 100644 index 79a682788b..0000000000 --- a/tests/auto/qtquick2/qquicklistview/data/creationContext.qml +++ /dev/null @@ -1,5 +0,0 @@ -import QtQuick 2.0 - -ComponentView { - title: "Hello!" -} diff --git a/tests/auto/qtquick2/qquicklistview/data/displaylist.qml b/tests/auto/qtquick2/qquicklistview/data/displaylist.qml deleted file mode 100644 index 4e8fd32f6a..0000000000 --- a/tests/auto/qtquick2/qquicklistview/data/displaylist.qml +++ /dev/null @@ -1,50 +0,0 @@ -import QtQuick 2.0 - -Rectangle { - id: root - property real delegateHeight: 20 - width: 240 - height: 320 - color: "#ffffff" - resources: [ - Component { - id: myDelegate - Rectangle { - id: wrapper - objectName: "wrapper" - height: root.delegateHeight - Behavior on height { NumberAnimation { duration: 200} } - width: 240 - Text { - text: index - } - Text { - x: 30 - objectName: "displayText" - text: display - } - Text { - x: 200 - text: wrapper.y - } - color: ListView.isCurrentItem ? "lightsteelblue" : "white" - } - }, - Component { - id: myHighlight - Rectangle { color: "green" } - } - ] - ListView { - id: list - objectName: "list" - focus: true - width: 240 - height: 320 - model: testModel - delegate: myDelegate - highlight: myHighlight - highlightMoveSpeed: 1000 - highlightResizeSpeed: 1000 - } -} diff --git a/tests/auto/qtquick2/qquicklistview/data/fillModelOnComponentCompleted.qml b/tests/auto/qtquick2/qquicklistview/data/fillModelOnComponentCompleted.qml deleted file mode 100644 index 906e6adb6b..0000000000 --- a/tests/auto/qtquick2/qquicklistview/data/fillModelOnComponentCompleted.qml +++ /dev/null @@ -1,36 +0,0 @@ -import QtQuick 2.0 - -Rectangle { - width: 240 - height: 320 - color: "#ffffff" - - ListModel { id: testModel } - - ListView { - id: list - objectName: "list" - width: parent.width - anchors.top: parent.top - anchors.bottom: parent.bottom - model: testModel - - delegate: Text { - objectName: "wrapper" - font.pointSize: 20 - text: index - } - footer: Rectangle { - width: parent.width - height: 40 - color: "green" - } - header: Text { objectName: "header"; text: "Header" } - } - - Component.onCompleted: { - if (setCurrentToZero == 0) - list.currentIndex = 0 - for (var i=0; i<30; i++) testModel.append({"name" : i, "val": i}) - } -} diff --git a/tests/auto/qtquick2/qquicklistview/data/footer.qml b/tests/auto/qtquick2/qquicklistview/data/footer.qml deleted file mode 100644 index 2a5619999e..0000000000 --- a/tests/auto/qtquick2/qquicklistview/data/footer.qml +++ /dev/null @@ -1,46 +0,0 @@ -import QtQuick 2.0 - -Rectangle { - property bool showHeader: false - - function changeFooter() { - list.footer = footer2 - } - width: 240 - height: 320 - color: "#ffffff" - Component { - id: myDelegate - Rectangle { - id: wrapper - objectName: "wrapper" - height: 20 - width: 40 - Text { - text: index + " " + x + "," + y - } - color: ListView.isCurrentItem ? "lightsteelblue" : "white" - } - } - Component { - id: headerComponent - Text { objectName: "header"; text: "Header " + x + "," + y; width: 100; height: 30 } - } - - ListView { - id: list - objectName: "list" - focus: true - width: 240 - height: 320 - model: testModel - delegate: myDelegate - header: parent.showHeader ? headerComponent : null - footer: Text { objectName: "footer"; text: "Footer " + x + "," + y; width: 100; height: 30 } - } - - Component { - id: footer2 - Text { objectName: "footer2"; text: "Footer 2 " + x + "," + y; width: 50; height: 20 } - } -} diff --git a/tests/auto/qtquick2/qquicklistview/data/header.qml b/tests/auto/qtquick2/qquicklistview/data/header.qml deleted file mode 100644 index bf70310630..0000000000 --- a/tests/auto/qtquick2/qquicklistview/data/header.qml +++ /dev/null @@ -1,39 +0,0 @@ -import QtQuick 2.0 - -Rectangle { - function changeHeader() { - list.header = header2 - } - width: 240 - height: 320 - color: "#ffffff" - Component { - id: myDelegate - Rectangle { - id: wrapper - objectName: "wrapper" - height: 30 - width: 240 - Text { - text: index + " " + x + "," + y - } - color: ListView.isCurrentItem ? "lightsteelblue" : "white" - } - } - ListView { - id: list - objectName: "list" - focus: true - width: initialViewWidth - height: initialViewHeight - snapMode: ListView.SnapToItem - model: testModel - delegate: myDelegate - header: Text { objectName: "header"; text: "Header " + x + "," + y; width: 100; height: 30 } - } - Component { - id: header2 - Text { objectName: "header2"; text: "Header " + x + "," + y; width: 50; height: 20 } - } - -} diff --git a/tests/auto/qtquick2/qquicklistview/data/headerfooter.qml b/tests/auto/qtquick2/qquicklistview/data/headerfooter.qml deleted file mode 100644 index 8e8463d645..0000000000 --- a/tests/auto/qtquick2/qquicklistview/data/headerfooter.qml +++ /dev/null @@ -1,26 +0,0 @@ -import QtQuick 2.0 - -ListView { - id: view - property bool horizontal: false - property bool rtl: false - width: 240 - height: 320 - - orientation: horizontal ? ListView.Horizontal : ListView.Vertical - header: Rectangle { - objectName: "header" - width: horizontal ? 20 : view.width - height: horizontal ? view.height : 20 - color: "red" - } - footer: Rectangle { - objectName: "footer" - width: horizontal ? 30 : view.width - height: horizontal ? view.height : 30 - color: "blue" - } - - delegate: Text { width: 30; height: 30; text: index + "(" + x + ")" } - layoutDirection: rtl ? Qt.RightToLeft : Qt.LeftToRight -} diff --git a/tests/auto/qtquick2/qquicklistview/data/itemlist.qml b/tests/auto/qtquick2/qquicklistview/data/itemlist.qml deleted file mode 100644 index 5c7ecdd5e8..0000000000 --- a/tests/auto/qtquick2/qquicklistview/data/itemlist.qml +++ /dev/null @@ -1,46 +0,0 @@ -// This example demonstrates placing items in a view using -// a VisualItemModel - -import QtQuick 2.0 - -Rectangle { - color: "lightgray" - width: 240 - height: 320 - - VisualItemModel { - id: itemModel - objectName: "itemModel" - Rectangle { - objectName: "item1" - height: ListView.view ? ListView.view.height : 0 - width: view.width; color: "#FFFEF0" - Text { objectName: "text1"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent } - } - Rectangle { - objectName: "item2" - height: ListView.view ? ListView.view.height : 0 - width: view.width; color: "#F0FFF7" - Text { objectName: "text2"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent } - } - Rectangle { - objectName: "item3" - height: ListView.view ? ListView.view.height : 0 - width: view.width; color: "#F4F0FF" - Text { objectName: "text3"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent } - } - } - - ListView { - id: view - objectName: "view" - anchors.fill: parent - anchors.bottomMargin: 30 - model: itemModel - preferredHighlightBegin: 0 - preferredHighlightEnd: 0 - highlightRangeMode: "StrictlyEnforceRange" - orientation: ListView.Horizontal - flickDeceleration: 2000 - } -} diff --git a/tests/auto/qtquick2/qquicklistview/data/listview-enforcerange-nohighlight.qml b/tests/auto/qtquick2/qquicklistview/data/listview-enforcerange-nohighlight.qml deleted file mode 100644 index 1db1096499..0000000000 --- a/tests/auto/qtquick2/qquicklistview/data/listview-enforcerange-nohighlight.qml +++ /dev/null @@ -1,61 +0,0 @@ -import QtQuick 2.0 - -Rectangle { - width: 240 - height: 320 - - Component { - id: myDelegate - Rectangle { - id: wrapper - objectName: "wrapper" - height: 20 - width: 240 - color: "transparent" - Text { - text: index - } - Text { - x: 30 - id: textName - objectName: "textName" - text: name - } - Text { - x: 120 - id: textNumber - objectName: "textNumber" - text: number - } - Text { - x: 200 - text: wrapper.y - } - } - } - - Rectangle { // current listview item should be always in this area - y: 100 - height: 20 - width: 240 - color: "purple" - } - - ListView { - id: list - objectName: "list" - width: 240 - height: 320 - model: testModel - delegate: myDelegate - focus: true - - preferredHighlightBegin: 100 - preferredHighlightEnd: 100 - highlightRangeMode: "StrictlyEnforceRange" - - section.property: "number" - section.delegate: Rectangle { width: 240; height: 10; color: "lightsteelblue" } - } -} - diff --git a/tests/auto/qtquick2/qquicklistview/data/listview-enforcerange.qml b/tests/auto/qtquick2/qquicklistview/data/listview-enforcerange.qml deleted file mode 100644 index f1bf6c2b57..0000000000 --- a/tests/auto/qtquick2/qquicklistview/data/listview-enforcerange.qml +++ /dev/null @@ -1,55 +0,0 @@ -import QtQuick 2.0 - -Rectangle { - width: 240 - height: 320 - color: "#ffffff" - Component { - id: myDelegate - Item { - id: wrapper - objectName: "wrapper" - height: 20 - width: 240 - Text { - text: index - } - Text { - x: 30 - id: textName - objectName: "textName" - text: name - } - Text { - x: 120 - id: textNumber - objectName: "textNumber" - text: number - } - Text { - x: 200 - text: wrapper.y - } - } - } - - Component { - id: myHighlight - Rectangle { - color: "lightsteelblue" - } - } - - ListView { - id: list - objectName: "list" - width: 240 - height: 320 - model: testModel - delegate: myDelegate - highlight: myHighlight - preferredHighlightBegin: 100 - preferredHighlightEnd: 100 - highlightRangeMode: "StrictlyEnforceRange" - } -} diff --git a/tests/auto/qtquick2/qquicklistview/data/listview-initCurrent.qml b/tests/auto/qtquick2/qquicklistview/data/listview-initCurrent.qml deleted file mode 100644 index c4f1860eda..0000000000 --- a/tests/auto/qtquick2/qquicklistview/data/listview-initCurrent.qml +++ /dev/null @@ -1,64 +0,0 @@ -import QtQuick 2.0 - -Rectangle { - id: root - - property int current: list.currentIndex - property bool showHeader: false - property bool showFooter: false - - width: 240 - height: 320 - color: "#ffffff" - resources: [ - Component { - id: myDelegate - Rectangle { - id: wrapper - objectName: "wrapper" - height: 20 - width: 240 - Text { - text: index - } - Text { - x: 30 - id: textName - objectName: "textName" - text: name - } - Text { - x: 120 - id: textNumber - objectName: "textNumber" - text: number - } - Text { - x: 200 - text: wrapper.y - } - color: ListView.isCurrentItem ? "lightsteelblue" : "white" - } - } - ] - - Component { - id: headerFooter - Rectangle { height: 30; width: 240; color: "blue" } - } - - ListView { - id: list - objectName: "list" - focus: true - currentIndex: 20 - width: 240 - height: 320 - keyNavigationWraps: testWrap - delegate: myDelegate - highlightMoveSpeed: 1000 - model: testModel - header: root.showHeader ? headerFooter : null - footer: root.showFooter ? headerFooter : null - } -} diff --git a/tests/auto/qtquick2/qquicklistview/data/listview-noCurrent.qml b/tests/auto/qtquick2/qquicklistview/data/listview-noCurrent.qml deleted file mode 100644 index 079966d8e4..0000000000 --- a/tests/auto/qtquick2/qquicklistview/data/listview-noCurrent.qml +++ /dev/null @@ -1,50 +0,0 @@ -import QtQuick 2.0 - -Rectangle { - property int current: list.currentIndex - width: 240 - height: 320 - color: "#ffffff" - resources: [ - Component { - id: myDelegate - Rectangle { - id: wrapper - objectName: "wrapper" - height: 20 - width: 240 - Text { - text: index - } - Text { - x: 30 - id: textName - objectName: "textName" - text: name - } - Text { - x: 120 - id: textNumber - objectName: "textNumber" - text: number - } - Text { - x: 200 - text: wrapper.y - } - color: ListView.isCurrentItem ? "lightsteelblue" : "white" - } - } - ] - ListView { - id: list - objectName: "list" - focus: true - currentIndex: -1 - width: 240 - height: 320 - delegate: myDelegate - highlightMoveSpeed: 1000 - model: testModel - } -} diff --git a/tests/auto/qtquick2/qquicklistview/data/listview-sections-package.qml b/tests/auto/qtquick2/qquicklistview/data/listview-sections-package.qml deleted file mode 100644 index 8e5a4c4aa7..0000000000 --- a/tests/auto/qtquick2/qquicklistview/data/listview-sections-package.qml +++ /dev/null @@ -1,72 +0,0 @@ -import QtQuick 2.0 - -Rectangle { - width: 240 - height: 320 - color: "#ffffff" - resources: [ - Component { - id: myDelegate - Package { - Item { - id: wrapper - objectName: "wrapper" - height: ListView.previousSection != ListView.section ? 40 : 20; - width: 240 - Package.name: "package" - Rectangle { - y: wrapper.ListView.previousSection != wrapper.ListView.section ? 20 : 0 - height: 20 - width: parent.width - color: wrapper.ListView.isCurrentItem ? "lightsteelblue" : "white" - Text { - text: index - } - Text { - x: 30 - id: textName - objectName: "textName" - text: name - } - Text { - x: 100 - id: textNumber - objectName: "textNumber" - text: number - } - Text { - objectName: "nextSection" - x: 150 - text: wrapper.ListView.nextSection - } - Text { - x: 200 - text: wrapper.y - } - } - Rectangle { - color: "#99bb99" - height: wrapper.ListView.previousSection != wrapper.ListView.section ? 20 : 0 - width: parent.width - visible: wrapper.ListView.previousSection != wrapper.ListView.section ? true : false - Text { text: wrapper.ListView.section } - } - } - } - }, - VisualDataModel { - id: visualModel - model: testModel - delegate: myDelegate - } - - ] - ListView { - id: list - objectName: "list" - width: 240 - height: 320 - model: visualModel.parts.package - section.property: "number" - } -} diff --git a/tests/auto/qtquick2/qquicklistview/data/listview-sections.qml b/tests/auto/qtquick2/qquicklistview/data/listview-sections.qml deleted file mode 100644 index d5b8a4400d..0000000000 --- a/tests/auto/qtquick2/qquicklistview/data/listview-sections.qml +++ /dev/null @@ -1,64 +0,0 @@ -import QtQuick 2.0 - -Rectangle { - width: 240 - height: 320 - color: "#ffffff" - resources: [ - Component { - id: myDelegate - Item { - id: wrapper - objectName: "wrapper" - height: ListView.previousSection != ListView.section ? 40 : 20; - width: 240 - Rectangle { - y: wrapper.ListView.previousSection != wrapper.ListView.section ? 20 : 0 - height: 20 - width: parent.width - color: wrapper.ListView.isCurrentItem ? "lightsteelblue" : "white" - Text { - text: index - } - Text { - x: 30 - id: textName - objectName: "textName" - text: name - } - Text { - x: 100 - id: textNumber - objectName: "textNumber" - text: number - } - Text { - objectName: "nextSection" - x: 150 - text: wrapper.ListView.nextSection - } - Text { - x: 200 - text: wrapper.y - } - } - Rectangle { - color: "#99bb99" - height: wrapper.ListView.previousSection != wrapper.ListView.section ? 20 : 0 - width: parent.width - visible: wrapper.ListView.previousSection != wrapper.ListView.section ? true : false - Text { text: wrapper.ListView.section } - } - } - } - ] - ListView { - id: list - objectName: "list" - width: 240 - height: 320 - model: testModel - delegate: myDelegate - section.property: "number" - } -} diff --git a/tests/auto/qtquick2/qquicklistview/data/listview-sections_delegate.qml b/tests/auto/qtquick2/qquicklistview/data/listview-sections_delegate.qml deleted file mode 100644 index 496d8d7784..0000000000 --- a/tests/auto/qtquick2/qquicklistview/data/listview-sections_delegate.qml +++ /dev/null @@ -1,71 +0,0 @@ -import QtQuick 2.0 - -Rectangle { - property string sectionProperty: "number" - property int sectionPositioning: ViewSection.InlineLabels - width: 240 - height: 320 - color: "#ffffff" - resources: [ - Component { - id: myDelegate - Item { - id: wrapper - objectName: "wrapper" - height: 20; - width: 240 - Rectangle { - height: 20 - width: parent.width - color: wrapper.ListView.isCurrentItem ? "lightsteelblue" : "white" - Text { - text: index - } - Text { - x: 30 - id: textName - objectName: "textName" - text: name - } - Text { - x: 100 - id: textNumber - objectName: "textNumber" - text: number - } - Text { - objectName: "nextSection" - x: 150 - text: wrapper.ListView.nextSection - } - Text { - x: 200 - text: wrapper.y - } - } - ListView.onRemove: SequentialAnimation { - PropertyAction { target: wrapper; property: "ListView.delayRemove"; value: true } - NumberAnimation { target: wrapper; property: "height"; to: 0; duration: 100; easing.type: Easing.InOutQuad } - PropertyAction { target: wrapper; property: "ListView.delayRemove"; value: false } - } - } - } - ] - ListView { - id: list - objectName: "list" - width: 240 - height: 320 - model: testModel - delegate: myDelegate - section.property: sectionProperty - section.delegate: Rectangle { - objectName: "sect_" + section - color: "#99bb99" - height: 20 - width: list.width - Text { text: section + ", " + parent.y + ", " + parent.objectName } - } - section.labelPositioning: sectionPositioning - } -} diff --git a/tests/auto/qtquick2/qquicklistview/data/listviewtest-package.qml b/tests/auto/qtquick2/qquicklistview/data/listviewtest-package.qml deleted file mode 100644 index 54d4dabc86..0000000000 --- a/tests/auto/qtquick2/qquicklistview/data/listviewtest-package.qml +++ /dev/null @@ -1,145 +0,0 @@ -import QtQuick 2.0 - -Rectangle { - id: root - width: 240 - height: 320 - color: "#ffffff" - - property int count: list.count - property bool showHeader: false - property bool showFooter: false - property real hr: list.visibleArea.heightRatio - function heightRatio() { - return list.visibleArea.heightRatio - } - - function checkProperties() { - testObject.error = false; - if (visualModel.model != testModel) { - console.log("model property incorrect"); - testObject.error = true; - } - if (!testObject.animate && visualModel.delegate != myDelegate) { - console.log("delegate property incorrect - expected myDelegate"); - testObject.error = true; - } - if (testObject.animate && visualModel.delegate != animatedDelegate) { - console.log("delegate property incorrect - expected animatedDelegate"); - testObject.error = true; - } - if (testObject.invalidHighlight && list.highlight != invalidHl) { - console.log("highlight property incorrect - expected invalidHl"); - testObject.error = true; - } - if (!testObject.invalidHighlight && list.highlight != myHighlight) { - console.log("highlight property incorrect - expected myHighlight"); - testObject.error = true; - } - } - resources: [ - Component { - id: myDelegate - Package { - Rectangle { - id: wrapper - objectName: "wrapper" - height: 20 - width: 240 - Package.name: "package" - Text { - text: index - } - Text { - x: 30 - id: textName - objectName: "textName" - text: name - } - Text { - x: 120 - id: textNumber - objectName: "textNumber" - text: number - } - Text { - x: 200 - text: wrapper.y - } - color: ListView.isCurrentItem ? "lightsteelblue" : "white" - } - } - }, - Component { - id: animatedDelegate - Package { - Rectangle { - id: wrapper - objectName: "wrapper" - height: 20 - width: 240 - Package.name: "package" - Text { - text: index - } - Text { - x: 30 - id: textName - objectName: "textName" - text: name - } - Text { - x: 120 - id: textNumber - objectName: "textNumber" - text: number - } - Text { - x: 200 - text: wrapper.y - } - color: ListView.isCurrentItem ? "lightsteelblue" : "white" - ListView.onRemove: SequentialAnimation { - PropertyAction { target: wrapper; property: "ListView.delayRemove"; value: true } - NumberAnimation { target: wrapper; property: "scale"; to: 0; duration: 250; easing.type: "InOutQuad" } - PropertyAction { target: wrapper; property: "ListView.delayRemove"; value: false } - - } - } - } - }, - Component { - id: myHighlight - Rectangle { color: "green" } - }, - Component { - id: invalidHl - SmoothedAnimation {} - }, - Component { - id: headerFooter - Rectangle { height: 30; width: 240; color: "blue" } - }, - VisualDataModel { - id: visualModel - - model: testModel - delegate: testObject.animate ? animatedDelegate : myDelegate - } - - ] - ListView { - id: list - objectName: "list" - focus: true - width: 240 - height: 320 - model: visualModel.parts.package - highlight: testObject.invalidHighlight ? invalidHl : myHighlight - highlightMoveSpeed: 1000 - highlightResizeSpeed: 1000 - cacheBuffer: testObject.cacheBuffer - header: root.showHeader ? headerFooter : null - footer: root.showFooter ? headerFooter : null - } -} diff --git a/tests/auto/qtquick2/qquicklistview/data/listviewtest.qml b/tests/auto/qtquick2/qquicklistview/data/listviewtest.qml deleted file mode 100644 index 47b341c1fc..0000000000 --- a/tests/auto/qtquick2/qquicklistview/data/listviewtest.qml +++ /dev/null @@ -1,133 +0,0 @@ -import QtQuick 2.0 - -Rectangle { - id: root - width: 240 - height: 320 - color: "#ffffff" - - property int count: list.count - property bool showHeader: false - property bool showFooter: false - property real hr: list.visibleArea.heightRatio - function heightRatio() { - return list.visibleArea.heightRatio - } - - function checkProperties() { - testObject.error = false; - if (list.model != testModel) { - console.log("model property incorrect"); - testObject.error = true; - } - if (!testObject.animate && list.delegate != myDelegate) { - console.log("delegate property incorrect - expected myDelegate"); - testObject.error = true; - } - if (testObject.animate && list.delegate != animatedDelegate) { - console.log("delegate property incorrect - expected animatedDelegate"); - testObject.error = true; - } - if (testObject.invalidHighlight && list.highlight != invalidHl) { - console.log("highlight property incorrect - expected invalidHl"); - testObject.error = true; - } - if (!testObject.invalidHighlight && list.highlight != myHighlight) { - console.log("highlight property incorrect - expected myHighlight"); - testObject.error = true; - } - } - resources: [ - Component { - id: myDelegate - Rectangle { - id: wrapper - objectName: "wrapper" - height: 20 - width: 240 - Text { - text: index - } - Text { - x: 30 - id: textName - objectName: "textName" - text: name - } - Text { - x: 120 - id: textNumber - objectName: "textNumber" - text: number - } - Text { - x: 200 - text: wrapper.y - } - color: ListView.isCurrentItem ? "lightsteelblue" : "#EEEEEE" - } - }, - Component { - id: animatedDelegate - Rectangle { - id: wrapper - objectName: "wrapper" - height: 20 - width: 240 - Text { - text: index - } - Text { - x: 30 - id: textName - objectName: "textName" - text: name - } - Text { - x: 120 - id: textNumber - objectName: "textNumber" - text: number - } - Text { - x: 200 - text: wrapper.y - } - color: ListView.isCurrentItem ? "lightsteelblue" : "white" - ListView.onRemove: SequentialAnimation { - PropertyAction { target: wrapper; property: "ListView.delayRemove"; value: true } - NumberAnimation { target: wrapper; property: "scale"; to: 0; duration: 250; easing.type: "InOutQuad" } - PropertyAction { target: wrapper; property: "ListView.delayRemove"; value: false } - - } - } - }, - Component { - id: myHighlight - Rectangle { color: "green" } - }, - Component { - id: invalidHl - SmoothedAnimation {} - }, - Component { - id: headerFooter - Rectangle { height: 30; width: 240; color: "blue" } - } - ] - ListView { - id: list - objectName: "list" - focus: true - width: 240 - height: 320 - model: testModel - delegate: testObject.animate ? animatedDelegate : myDelegate - highlight: testObject.invalidHighlight ? invalidHl : myHighlight - highlightMoveSpeed: 1000 - highlightResizeSpeed: 1000 - cacheBuffer: testObject.cacheBuffer - header: root.showHeader ? headerFooter : null - footer: root.showFooter ? headerFooter : null - } -} diff --git a/tests/auto/qtquick2/qquicklistview/data/manual-highlight.qml b/tests/auto/qtquick2/qquicklistview/data/manual-highlight.qml deleted file mode 100644 index aac4599f01..0000000000 --- a/tests/auto/qtquick2/qquicklistview/data/manual-highlight.qml +++ /dev/null @@ -1,47 +0,0 @@ -import QtQuick 2.0 - -Item { - - ListModel { - id: model - ListElement { - name: "Bill Smith" - number: "555 3264" - } - ListElement { - name: "John Brown" - number: "555 8426" - } - ListElement { - name: "Sam Wise" - number: "555 0473" - } - ListElement { - name: "Bob Brown" - number: "555 5845" - } - } - - Component { - id: highlight - Rectangle { - objectName: "highlight" - width: 180; height: 20 - color: "lightsteelblue"; radius: 5 - y: list.currentItem.y+5 - } - } - - ListView { - id: list - objectName: "list" - anchors.fill: parent - model: model - delegate: Text { objectName: "wrapper"; text: name } - - highlight: highlight - highlightFollowsCurrentItem: false - focus: true - } - -} diff --git a/tests/auto/qtquick2/qquicklistview/data/margins.qml b/tests/auto/qtquick2/qquicklistview/data/margins.qml deleted file mode 100644 index 19bbef500f..0000000000 --- a/tests/auto/qtquick2/qquicklistview/data/margins.qml +++ /dev/null @@ -1,47 +0,0 @@ -import QtQuick 2.0 - -Rectangle { - id: root - width: 240 - height: 320 - color: "#ffffff" - - Component { - id: myDelegate - Rectangle { - id: wrapper - objectName: "wrapper" - height: 20 - width: 240 - Text { - text: index - } - Text { - x: 30 - id: textName - objectName: "textName" - text: name - } - Text { - x: 120 - id: textNumber - objectName: "textNumber" - text: number - } - Text { - x: 200 - text: wrapper.y - } - color: ListView.isCurrentItem ? "lightsteelblue" : "white" - } - } - ListView { - id: list - objectName: "list" - anchors.fill: parent - topMargin: 30 - bottomMargin: 50 - model: testModel - delegate: myDelegate - } -} diff --git a/tests/auto/qtquick2/qquicklistview/data/margins2.qml b/tests/auto/qtquick2/qquicklistview/data/margins2.qml deleted file mode 100644 index e11c803c4b..0000000000 --- a/tests/auto/qtquick2/qquicklistview/data/margins2.qml +++ /dev/null @@ -1,29 +0,0 @@ -import QtQuick 2.0 - -Item { - width: 200; height: 200 - Page { - Rectangle { - anchors.fill: parent - color: "lightsteelblue" - } - ListView { - objectName: "listview" - topMargin: 20 - bottomMargin: 20 - leftMargin: 20 - rightMargin: 20 - anchors.fill: parent - - model: 20 - delegate: Rectangle { - color: "skyblue" - width: 60; height: 60 - Text { - id: txt - text: "test" + index - } - } - } - } -} diff --git a/tests/auto/qtquick2/qquicklistview/data/moveTransitions.qml b/tests/auto/qtquick2/qquicklistview/data/moveTransitions.qml deleted file mode 100644 index 744db3110e..0000000000 --- a/tests/auto/qtquick2/qquicklistview/data/moveTransitions.qml +++ /dev/null @@ -1,141 +0,0 @@ -import QtQuick 2.0 - -Rectangle { - id: root - width: 500 - height: 600 - - property int duration: 10 - property int count: list.count - - Component { - id: myDelegate - Rectangle { - id: wrapper - - property string nameData: name - - objectName: "wrapper" - height: 20 - width: 240 - Text { text: index } - Text { - x: 30 - id: textName - objectName: "textName" - text: name - } - Text { - x: 200 - text: wrapper.y - } - color: ListView.isCurrentItem ? "lightsteelblue" : "white" - - onXChanged: checkPos() - onYChanged: checkPos() - - function checkPos() { - if (Qt.point(x, y) == targetItems_transitionVia) - model_targetItems_transitionVia.addItem(name, "") - if (Qt.point(x, y) == displacedItems_transitionVia) - model_displacedItems_transitionVia.addItem(name, "") - } - } - } - - ListView { - id: list - - property int targetTransitionsDone - property int displaceTransitionsDone - - property var targetTrans_items: new Object() - property var targetTrans_targetIndexes: new Array() - property var targetTrans_targetItems: new Array() - - property var displacedTrans_items: new Object() - property var displacedTrans_targetIndexes: new Array() - property var displacedTrans_targetItems: new Array() - - objectName: "list" - focus: true - anchors.centerIn: parent - width: 240 - height: 320 - model: testModel - delegate: myDelegate - - // for QDeclarativeListProperty types - function copyList(propList) { - var temp = new Array() - for (var i=0; i<propList.length; i++) - temp.push(propList[i]) - return temp - } - - move: Transition { - id: targetTransition - - SequentialAnimation { - ScriptAction { - script: { - list.targetTrans_items[targetTransition.ViewTransition.item.nameData] = targetTransition.ViewTransition.index - list.targetTrans_targetIndexes.push(targetTransition.ViewTransition.targetIndexes) - list.targetTrans_targetItems.push(list.copyList(targetTransition.ViewTransition.targetItems)) - } - } - ParallelAnimation { - NumberAnimation { properties: "x"; to: targetItems_transitionVia.x; duration: root.duration } - NumberAnimation { properties: "y"; to: targetItems_transitionVia.y; duration: root.duration } - } - - NumberAnimation { properties: "x,y"; duration: root.duration } - - ScriptAction { script: list.targetTransitionsDone += 1 } - } - } - - moveDisplaced: Transition { - id: displaced - - SequentialAnimation { - ScriptAction { - script: { - list.displacedTrans_items[displaced.ViewTransition.item.nameData] = displaced.ViewTransition.index - list.displacedTrans_targetIndexes.push(displaced.ViewTransition.targetIndexes) - list.displacedTrans_targetItems.push(list.copyList(displaced.ViewTransition.targetItems)) - } - } - ParallelAnimation { - NumberAnimation { - properties: "x"; duration: root.duration - to: displacedItems_transitionVia.x - } - NumberAnimation { - properties: "y"; duration: root.duration - to: displacedItems_transitionVia.y - } - } - NumberAnimation { properties: "x,y"; duration: root.duration } - - ScriptAction { script: list.displaceTransitionsDone += 1 } - } - - } - } - - Rectangle { - anchors.fill: list - color: "lightsteelblue" - opacity: 0.2 - } - - Rectangle { - anchors.bottom: parent.bottom - width: 20; height: 20 - color: "white" - NumberAnimation on x { loops: Animation.Infinite; from: 0; to: 300; duration: 10000 } - } -} - - diff --git a/tests/auto/qtquick2/qquicklistview/data/multipleTransitions.qml b/tests/auto/qtquick2/qquicklistview/data/multipleTransitions.qml deleted file mode 100644 index 50ffbc53c3..0000000000 --- a/tests/auto/qtquick2/qquicklistview/data/multipleTransitions.qml +++ /dev/null @@ -1,121 +0,0 @@ -import QtQuick 2.0 - -Rectangle { - id: root - width: 500 - height: 600 - - // time to pause between each add, remove, etc. - // (obviously, must be less than 'duration' value to actually test that - // interrupting transitions will still produce the correct result) - property int timeBetweenActions: duration / 2 - - property int duration: 100 - - property int count: list.count - - Component { - id: myDelegate - Rectangle { - id: wrapper - objectName: "wrapper" - height: 20 - width: 240 - Text { text: index } - Text { - x: 30 - id: textName - objectName: "textName" - text: name - } - Text { - x: 200 - text: wrapper.y - } - color: ListView.isCurrentItem ? "lightsteelblue" : "white" - } - } - - ListView { - id: list - - property bool populateDone - - property bool runningAddTargets: false - property bool runningAddDisplaced: false - property bool runningMoveTargets: false - property bool runningMoveDisplaced: false - - objectName: "list" - focus: true - anchors.centerIn: parent - width: 240 - height: 320 - model: testModel - delegate: myDelegate - - add: Transition { - id: addTargets - SequentialAnimation { - ScriptAction { script: list.runningAddTargets = true } - ParallelAnimation { - NumberAnimation { properties: "x"; from: addTargets_transitionFrom.x; duration: root.duration } - NumberAnimation { properties: "y"; from: addTargets_transitionFrom.y; duration: root.duration } - } - ScriptAction { script: list.runningAddTargets = false } - } - } - - addDisplaced: Transition { - id: addDisplaced - SequentialAnimation { - ScriptAction { script: list.runningAddDisplaced = true } - ParallelAnimation { - NumberAnimation { properties: "x"; from: addDisplaced_transitionFrom.x; duration: root.duration } - NumberAnimation { properties: "y"; from: addDisplaced_transitionFrom.y; duration: root.duration } - } - ScriptAction { script: list.runningAddDisplaced = false } - } - } - - move: Transition { - id: moveTargets - SequentialAnimation { - ScriptAction { script: list.runningMoveTargets = true } - ParallelAnimation { - NumberAnimation { properties: "x"; from: moveTargets_transitionFrom.x; duration: root.duration } - NumberAnimation { properties: "y"; from: moveTargets_transitionFrom.y; duration: root.duration } - } - ScriptAction { script: list.runningMoveTargets = false } - } - } - - moveDisplaced: Transition { - id: moveDisplaced - SequentialAnimation { - ScriptAction { script: list.runningMoveDisplaced = true } - ParallelAnimation { - NumberAnimation { properties: "x"; from: moveDisplaced_transitionFrom.x; duration: root.duration } - NumberAnimation { properties: "y"; from: moveDisplaced_transitionFrom.y; duration: root.duration } - } - ScriptAction { script: list.runningMoveDisplaced = false } - } - } - } - - Rectangle { - anchors.fill: list - color: "lightsteelblue" - opacity: 0.2 - } - - Rectangle { - anchors.bottom: parent.bottom - width: 20; height: 20 - color: "white" - NumberAnimation on x { loops: Animation.Infinite; from: 0; to: 300; duration: 100000 } - } -} - - - diff --git a/tests/auto/qtquick2/qquicklistview/data/populateTransitions.qml b/tests/auto/qtquick2/qquicklistview/data/populateTransitions.qml deleted file mode 100644 index 0994e0943d..0000000000 --- a/tests/auto/qtquick2/qquicklistview/data/populateTransitions.qml +++ /dev/null @@ -1,102 +0,0 @@ -import QtQuick 2.0 - -Rectangle { - id: root - width: 500 - height: 600 - - property int duration: 10 - property int count: list.count - - Component { - id: myDelegate - Rectangle { - id: wrapper - objectName: "wrapper" - height: 20 - width: 240 - Text { text: index } - Text { - x: 30 - id: textName - objectName: "textName" - text: name - } - Text { - x: 200 - text: wrapper.y - } - color: ListView.isCurrentItem ? "lightsteelblue" : "white" - - onXChanged: checkPos() - onYChanged: checkPos() - - function checkPos() { - if (Qt.point(x, y) == transitionFrom) - model_transitionFrom.addItem(name, "") - if (Qt.point(x, y) == transitionVia) { - model_transitionVia.addItem(name, "") - } - } - } - } - - ListView { - id: list - - property int countPopulateTransitions - property int countAddTransitions - - objectName: "list" - focus: true - anchors.centerIn: parent - width: 240 - height: 320 - model: testModel - delegate: myDelegate - - populate: usePopulateTransition ? popTransition : null - - add: Transition { - SequentialAnimation { - ScriptAction { script: list.countAddTransitions += 1 } - NumberAnimation { properties: "x,y"; duration: root.duration } - } - } - } - - Transition { - id: popTransition - SequentialAnimation { - ParallelAnimation { - NumberAnimation { properties: "x"; from: transitionFrom.x; to: transitionVia.x; duration: root.duration } - NumberAnimation { properties: "y"; from: transitionFrom.y; to: transitionVia.y; duration: root.duration } - } - NumberAnimation { properties: "x,y"; duration: root.duration } - ScriptAction { script: list.countPopulateTransitions += 1 } - } - } - - - Rectangle { - anchors.fill: list - color: "lightsteelblue" - opacity: 0.2 - } - - Component.onCompleted: { - if (dynamicallyPopulate) { - for (var i=0; i<30; i++) - testModel.addItem("item " + i, "") - } - } - - Rectangle { - anchors.bottom: parent.bottom - width: 20; height: 20 - color: "white" - NumberAnimation on x { loops: Animation.Infinite; from: 0; to: 300; duration: 100000 } - } -} - - diff --git a/tests/auto/qtquick2/qquicklistview/data/propertychangestest.qml b/tests/auto/qtquick2/qquicklistview/data/propertychangestest.qml deleted file mode 100644 index 146f3f13b0..0000000000 --- a/tests/auto/qtquick2/qquicklistview/data/propertychangestest.qml +++ /dev/null @@ -1,71 +0,0 @@ -import QtQuick 2.0 - -Rectangle { - width: 180; height: 120; color: "white" - Component { - id: delegate - Item { - id: wrapper - width: 180; height: 40; - Column { - x: 5; y: 5 - Text { text: '<b>Name:</b> ' + name } - Text { text: '<b>Number:</b> ' + number } - } - } - } - Component { - id: highlightRed - Rectangle { - color: "red" - radius: 10 - opacity: 0.5 - } - } - ListView { - objectName: "listView" - anchors.fill: parent - model: listModel - delegate: delegate - highlight: highlightRed - focus: true - highlightFollowsCurrentItem: true - preferredHighlightBegin: 0.0 - preferredHighlightEnd: 0.0 - highlightRangeMode: ListView.ApplyRange - keyNavigationWraps: true - cacheBuffer: 10 - snapMode: ListView.SnapToItem - } - - data:[ - ListModel { - id: listModel - ListElement { - name: "Bill Smith" - number: "555 3264" - } - ListElement { - name: "John Brown" - number: "555 8426" - } - ListElement { - name: "Sam Wise" - number: "555 0473" - } - }, - ListModel { - objectName: "alternateModel" - ListElement { - name: "Jack" - number: "555 8426" - } - ListElement { - name: "Mary" - number: "555 3264" - } - } - ] -} - - diff --git a/tests/auto/qtquick2/qquicklistview/data/qtbug-21742.qml b/tests/auto/qtquick2/qquicklistview/data/qtbug-21742.qml deleted file mode 100644 index 774f9041fb..0000000000 --- a/tests/auto/qtquick2/qquicklistview/data/qtbug-21742.qml +++ /dev/null @@ -1,36 +0,0 @@ -import QtQuick 2.0 - -Rectangle { - height: 200 - width: 200 - property int count: menuView.count - - Component.onCompleted: { setModel(); } - - function setModel() - { - menuModel.append({"enabledItem" : true}); - menuView.currentIndex = 0; - } - - ListModel { - id: menuModel - } - - ListView { - id: menuView - anchors.fill: parent - model: menuModel - delegate: mything - } - - Component { - id: mything - Rectangle { - height: 50 - width: 200 - color: index == menuView.currentIndex ? "green" : "blue" - } - } - -}
\ No newline at end of file diff --git a/tests/auto/qtquick2/qquicklistview/data/qtbug14821.qml b/tests/auto/qtquick2/qquicklistview/data/qtbug14821.qml deleted file mode 100644 index 0a5e0acbb4..0000000000 --- a/tests/auto/qtquick2/qquicklistview/data/qtbug14821.qml +++ /dev/null @@ -1,31 +0,0 @@ -import QtQuick 2.0 - -ListView { - id: view - width: 300; height: 200 - focus: true - keyNavigationWraps: true - - model: 100 - - preferredHighlightBegin: 90 - preferredHighlightEnd: 110 - - highlightRangeMode: ListView.StrictlyEnforceRange - highlight: Component { - Rectangle { - border.color: "blue" - border.width: 3 - color: "transparent" - width: 300; height: 15 - } - } - - delegate: Component { - Item { - height: 15 + (view.currentIndex == index ? 20 : 0) - width: 200 - Text { text: 'Index: ' + index; anchors.verticalCenter: parent.verticalCenter } - } - } -} diff --git a/tests/auto/qtquick2/qquicklistview/data/qtbug16037.qml b/tests/auto/qtquick2/qquicklistview/data/qtbug16037.qml deleted file mode 100644 index 21faeb3f32..0000000000 --- a/tests/auto/qtquick2/qquicklistview/data/qtbug16037.qml +++ /dev/null @@ -1,37 +0,0 @@ -import QtQuick 2.0 - -Item { - width: 640 - height: 480 - - function setModel() { - listView.model = listModel1 - } - - ListModel { - id: listModel1 - ListElement { text: "Apple" } - ListElement { text: "Banana" } - ListElement { text: "Orange" } - ListElement { text: "Coconut" } - } - - Rectangle { - width: 200 - height: listView.contentHeight - color: "yellow" - anchors.centerIn: parent - - ListView { - id: listView - objectName: "listview" - anchors.fill: parent - - delegate: Item { - width: 200 - height: 20 - Text { text: model.text; anchors.centerIn: parent } - } - } - } -} diff --git a/tests/auto/qtquick2/qquicklistview/data/removeTransitions.qml b/tests/auto/qtquick2/qquicklistview/data/removeTransitions.qml deleted file mode 100644 index 95f76f0200..0000000000 --- a/tests/auto/qtquick2/qquicklistview/data/removeTransitions.qml +++ /dev/null @@ -1,144 +0,0 @@ -import QtQuick 2.0 - -Rectangle { - id: root - width: 500 - height: 600 - - property int duration: 10 - property int count: list.count - - Component { - id: myDelegate - Rectangle { - id: wrapper - - property string nameData: name - - objectName: "wrapper" - height: 20 - width: 240 - Text { text: index } - Text { - x: 30 - id: textName - objectName: "textName" - text: name - } - Text { - x: 200 - text: wrapper.y - } - color: ListView.isCurrentItem ? "lightsteelblue" : "white" - - onXChanged: checkPos() - onYChanged: checkPos() - - function checkPos() { - if (Qt.point(x, y) == targetItems_transitionTo) { - model_targetItems_transitionTo.addItem(nameData, "") // name is invalid once model removes the item - } - if (Qt.point(x, y) == displacedItems_transitionVia) { - model_displacedItems_transitionVia.addItem(name, "") - } - } - } - } - - ListView { - id: list - - property int targetTransitionsDone - property int displaceTransitionsDone - - property var targetTrans_items: new Object() - property var targetTrans_targetIndexes: new Array() - property var targetTrans_targetItems: new Array() - - property var displacedTrans_items: new Object() - property var displacedTrans_targetIndexes: new Array() - property var displacedTrans_targetItems: new Array() - - objectName: "list" - focus: true - anchors.centerIn: parent - width: 240 - height: 320 - model: testModel - delegate: myDelegate - - // for QDeclarativeListProperty types - function copyList(propList) { - var temp = new Array() - for (var i=0; i<propList.length; i++) - temp.push(propList[i]) - return temp - } - - remove: Transition { - id: targetTransition - - SequentialAnimation { - ScriptAction { - script: { - list.targetTrans_items[targetTransition.ViewTransition.item.nameData] = targetTransition.ViewTransition.index - list.targetTrans_targetIndexes.push(targetTransition.ViewTransition.targetIndexes) - list.targetTrans_targetItems.push(list.copyList(targetTransition.ViewTransition.targetItems)) - } - } - ParallelAnimation { - NumberAnimation { properties: "x"; to: targetItems_transitionTo.x; duration: root.duration } - NumberAnimation { properties: "y"; to: targetItems_transitionTo.y; duration: root.duration } - } - ScriptAction { script: list.targetTransitionsDone += 1 } - - // delay deleting this item so that it stays valid for the tests - // (this doesn't delay the test itself) - PauseAnimation { duration: 10000 } - } - } - - removeDisplaced: Transition { - id: displaced - - SequentialAnimation { - ScriptAction { - script: { - list.displacedTrans_items[displaced.ViewTransition.item.nameData] = displaced.ViewTransition.index - list.displacedTrans_targetIndexes.push(displaced.ViewTransition.targetIndexes) - list.displacedTrans_targetItems.push(list.copyList(displaced.ViewTransition.targetItems)) - } - } - ParallelAnimation { - NumberAnimation { - properties: "x"; duration: root.duration - to: displacedItems_transitionVia.x - } - NumberAnimation { - properties: "y"; duration: root.duration - to: displacedItems_transitionVia.y - } - } - NumberAnimation { properties: "x,y"; duration: root.duration } - - ScriptAction { script: list.displaceTransitionsDone += 1 } - } - - } - } - - Rectangle { - anchors.fill: list - color: "lightsteelblue" - opacity: 0.2 - } - - Rectangle { - anchors.bottom: parent.bottom - width: 20; height: 20 - color: "white" - NumberAnimation on x { loops: Animation.Infinite; from: 0; to: 300; duration: 10000 } - } -} - - diff --git a/tests/auto/qtquick2/qquicklistview/data/resizeview.qml b/tests/auto/qtquick2/qquicklistview/data/resizeview.qml deleted file mode 100644 index 8b13adba40..0000000000 --- a/tests/auto/qtquick2/qquicklistview/data/resizeview.qml +++ /dev/null @@ -1,25 +0,0 @@ -import QtQuick 2.0 - -Rectangle { - id: root - - width: 240 - height: 240 - - property real initialHeight - - ListView { - id: list - objectName: "list" - width: 240 - height: initialHeight - model: testModel - delegate: Rectangle { - objectName: "wrapper" - width: 240 - height: 20 - border.width: 1 - } - } -} - diff --git a/tests/auto/qtquick2/qquicklistview/data/rightToLeft.qml b/tests/auto/qtquick2/qquicklistview/data/rightToLeft.qml deleted file mode 100644 index 6d77de26f4..0000000000 --- a/tests/auto/qtquick2/qquicklistview/data/rightToLeft.qml +++ /dev/null @@ -1,42 +0,0 @@ -// This example demonstrates how item positioning -// changes in right-to-left layout direction - -import QtQuick 2.0 - -Rectangle { - color: "lightgray" - width: 640 - height: 320 - - VisualItemModel { - id: itemModel - objectName: "itemModel" - Rectangle { - objectName: "item1" - height: view.height; width: 100; color: "#FFFEF0" - Text { objectName: "text1"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent } - } - Rectangle { - objectName: "item2" - height: view.height; width: 200; color: "#F0FFF7" - Text { objectName: "text2"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent } - } - Rectangle { - objectName: "item3" - height: view.height; width: 240; color: "#F4F0FF" - Text { objectName: "text3"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent } - } - } - - ListView { - id: view - objectName: "view" - anchors.fill: parent - anchors.bottomMargin: 30 - model: itemModel - highlightRangeMode: "StrictlyEnforceRange" - orientation: ListView.Horizontal - flickDeceleration: 2000 - layoutDirection: Qt.RightToLeft - } -} diff --git a/tests/auto/qtquick2/qquicklistview/data/sizelessthan1.qml b/tests/auto/qtquick2/qquicklistview/data/sizelessthan1.qml deleted file mode 100644 index aa9dc20ae9..0000000000 --- a/tests/auto/qtquick2/qquicklistview/data/sizelessthan1.qml +++ /dev/null @@ -1,26 +0,0 @@ -import QtQuick 2.0 - -Rectangle { - width: 240 - height: 320 - color: "#ffffff" - Component { - id: myDelegate - Rectangle { - id: wrapper - objectName: "wrapper" - height: 0.5 - width: 240 - color: ((index % 2) == 1 ? "red" : "blue") - } - } - ListView { - id: list - objectName: "list" - focus: true - width: 240 - height: 320 - model: testModel - delegate: myDelegate - } -} diff --git a/tests/auto/qtquick2/qquicklistview/data/snapOneItem.qml b/tests/auto/qtquick2/qquicklistview/data/snapOneItem.qml deleted file mode 100644 index d67d8040ca..0000000000 --- a/tests/auto/qtquick2/qquicklistview/data/snapOneItem.qml +++ /dev/null @@ -1,49 +0,0 @@ -import QtQuick 2.0 - -Rectangle { - id: root - width: 240 - height: 240 - color: "#ffffff" - - Component { - id: myDelegate - Rectangle { - id: wrapper - objectName: "wrapper" - height: 200 - width: 200 - Column { - Text { - text: index - } - Text { - text: wrapper.x + ", " + wrapper.y - } - } - color: ListView.isCurrentItem ? "lightsteelblue" : "transparent" - } - } - ListView { - id: list - objectName: "list" - anchors.fill: parent - preferredHighlightBegin: 20 - preferredHighlightEnd: 220 - snapMode: ListView.SnapOneItem - orientation: ListView.Horizontal - layoutDirection: Qt.RightToLeft - highlightRangeMode: ListView.StrictlyEnforceRange -// highlightRangeMode: ListView.NoHighlightRange - highlight: Rectangle { width: 200; height: 200; color: "yellow" } - flickDeceleration: 200 // encourages long flick - model: 4 - delegate: myDelegate - } - - Text { - anchors.right: parent.right - anchors.bottom: parent.bottom - text: list.contentX + ", " + list.contentY - } -} diff --git a/tests/auto/qtquick2/qquicklistview/data/snapToItem.qml b/tests/auto/qtquick2/qquicklistview/data/snapToItem.qml deleted file mode 100644 index 6f201072f0..0000000000 --- a/tests/auto/qtquick2/qquicklistview/data/snapToItem.qml +++ /dev/null @@ -1,49 +0,0 @@ -import QtQuick 2.0 - -Rectangle { - id: root - width: 240 - height: 240 - color: "#ffffff" - - Component { - id: myDelegate - Rectangle { - id: wrapper - objectName: "wrapper" - height: 80 - width: 80 - Column { - Text { - text: index - } - Text { - text: wrapper.x + ", " + wrapper.y - } - } - color: ListView.isCurrentItem ? "lightsteelblue" : "transparent" - } - } - ListView { - id: list - objectName: "list" - anchors.fill: parent -// preferredHighlightBegin: 20 -// preferredHighlightEnd: 100 - preferredHighlightBegin: 20 - preferredHighlightEnd: 100 - snapMode: ListView.SnapToItem - orientation: ListView.Horizontal - layoutDirection: Qt.RightToLeft - highlightRangeMode: ListView.StrictlyEnforceRange - highlight: Rectangle { width: 80; height: 80; color: "yellow" } - model: 18 - delegate: myDelegate - } - - Text { - anchors.right: parent.right - anchors.bottom: parent.bottom - text: list.contentX + ", " + list.contentY - } -} diff --git a/tests/auto/qtquick2/qquicklistview/data/strictlyenforcerange.qml b/tests/auto/qtquick2/qquicklistview/data/strictlyenforcerange.qml deleted file mode 100644 index 7960ac4abb..0000000000 --- a/tests/auto/qtquick2/qquicklistview/data/strictlyenforcerange.qml +++ /dev/null @@ -1,29 +0,0 @@ -import QtQuick 2.0 - -ListView { - id: list - objectName: "list" - width: 320 - height: 480 - - function fillModel() { - list.model.append({"col": "red"}); - list.currentIndex = list.count-1 - list.model.append({"col": "blue"}); - list.currentIndex = list.count-1 - list.model.append({"col": "green"}); - list.currentIndex = list.count-1 - } - - model: ListModel { id: listModel } // empty model - delegate: Rectangle { id: wrapper; objectName: "wrapper"; color: col; width: 300; height: 400 } - orientation: "Horizontal" - snapMode: "SnapToItem" - cacheBuffer: 1000 - - preferredHighlightBegin: 10 - preferredHighlightEnd: 10 - - highlightRangeMode: "StrictlyEnforceRange" - focus: true -} diff --git a/tests/auto/qtquick2/qquicklistview/data/unrequestedItems.qml b/tests/auto/qtquick2/qquicklistview/data/unrequestedItems.qml deleted file mode 100644 index 682f3833d1..0000000000 --- a/tests/auto/qtquick2/qquicklistview/data/unrequestedItems.qml +++ /dev/null @@ -1,63 +0,0 @@ -import QtQuick 2.0 - -Item { - width: 240 - height: 320 - - Component { - id: myDelegate - - Package { - Rectangle { - id: leftWrapper - objectName: "wrapper" - Package.name: "left" - height: 20 - width: 120 - Text { - text: index - } - color: ListView.isCurrentItem ? "lightsteelblue" : "white" - } - Rectangle { - id: rightWrapper - objectName: "wrapper" - Package.name: "right" - height: 20 - width: 120 - Text { - text: index - } - color: ListView.isCurrentItem ? "lightsteelblue" : "white" - } - } - - } - - VisualDataModel { - id: visualModel - - delegate: myDelegate - model: testModel - } - - ListView { - id: leftList - objectName: "leftList" - anchors { - left: parent.left; top: parent.top; - right: parent.horizontalCenter; bottom: parent.bottom - } - model: visualModel.parts.left - } - - ListView { - id: rightList - objectName: "rightList" - anchors { - left: parent.horizontalCenter; top: parent.top; - right: parent.right; bottom: parent.bottom - } - model: visualModel.parts.right - } -} |