aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquicklistview/data
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-12-20 08:32:22 +0100
committerLiang Qi <liang.qi@qt.io>2017-12-20 08:50:58 +0100
commit9a38fdcf8f9b734808bb54422e306872f3bfa944 (patch)
tree20fd361db6c505d99a40ab7a695511b97dcdcbd3 /tests/auto/quick/qquicklistview/data
parent1db9405128972d5ba77e33181bee40356f718cea (diff)
parent4fff2bb14e55484eacec0a1b49a2b02958f75eca (diff)
Merge remote-tracking branch 'origin/5.10' into dev
Conflicts: tests/auto/quick/pointerhandlers/flickableinterop/data/FlashAnimation.qml tests/auto/quick/pointerhandlers/flickableinterop/data/Slider.qml tests/auto/quick/pointerhandlers/flickableinterop/data/TapHandlerButton.qml tests/auto/quick/pointerhandlers/flickableinterop/data/flickableWithHandlers.qml tests/auto/quick/pointerhandlers/multipointtoucharea_interop/data/pinchDragMPTA.qml tests/auto/quick/pointerhandlers/qquickdraghandler/data/DragAnywhereSlider.qml tests/auto/quick/pointerhandlers/qquickdraghandler/data/FlashAnimation.qml tests/auto/quick/pointerhandlers/qquickdraghandler/data/Slider.qml tests/auto/quick/pointerhandlers/qquickdraghandler/data/draggables.qml tests/auto/quick/pointerhandlers/qquickdraghandler/data/multipleSliders.qml tests/auto/quick/pointerhandlers/qquicktaphandler/data/Button.qml tests/auto/quick/pointerhandlers/qquicktaphandler/data/FlashAnimation.qml tests/auto/quick/pointerhandlers/qquicktaphandler/data/buttons.qml tests/manual/pointer/content/FakeFlickable.qml tests/manual/pointer/content/FlashAnimation.qml tests/manual/pointer/content/MomentumAnimation.qml tests/manual/pointer/content/MouseAreaButton.qml tests/manual/pointer/content/MouseAreaSlider.qml tests/manual/pointer/content/MptaButton.qml tests/manual/pointer/content/MultiButton.qml tests/manual/pointer/content/ScrollBar.qml tests/manual/pointer/content/Slider.qml tests/manual/pointer/content/TapHandlerButton.qml tests/manual/pointer/fakeFlickable.qml tests/manual/pointer/flickableWithHandlers.qml tests/manual/pointer/flingAnimation.qml tests/manual/pointer/joystick.qml tests/manual/pointer/main.cpp tests/manual/pointer/main.qml tests/manual/pointer/map.qml tests/manual/pointer/map2.qml tests/manual/pointer/mixer.qml tests/manual/pointer/multibuttons.qml tests/manual/pointer/photosurface.qml tests/manual/pointer/pinchDragFlingMPTA.qml tests/manual/pointer/pinchHandler.qml tests/manual/pointer/singlePointHandlerProperties.qml tests/manual/pointer/tapHandler.qml tests/manual/pointer/tapWithModifiers.qml tests/manual/shapestest/main.cpp Change-Id: I4f233a521305fab1ebfecbac801da192434ed524
Diffstat (limited to 'tests/auto/quick/qquicklistview/data')
-rw-r--r--tests/auto/quick/qquicklistview/data/appendDuringScrollDown.qml28
-rw-r--r--tests/auto/quick/qquicklistview/data/qtbug34576.qml102
-rw-r--r--tests/auto/quick/qquicklistview/data/qtbug63974.qml34
3 files changed, 164 insertions, 0 deletions
diff --git a/tests/auto/quick/qquicklistview/data/appendDuringScrollDown.qml b/tests/auto/quick/qquicklistview/data/appendDuringScrollDown.qml
new file mode 100644
index 0000000000..af35c29143
--- /dev/null
+++ b/tests/auto/quick/qquicklistview/data/appendDuringScrollDown.qml
@@ -0,0 +1,28 @@
+import QtQuick 2.6
+
+ListView {
+ width: 320; height: 240
+ focus: true
+ delegate: Text {
+ height: 40; width: parent.width
+ text: model.text
+ verticalAlignment: Text.AlignVCenter
+ horizontalAlignment: Text.AlignHCenter
+ }
+ highlight: Rectangle { color: "red" }
+ model: ListModel {
+ ListElement { text: "0" }
+ ListElement { text: "1" }
+ ListElement { text: "2" }
+ ListElement { text: "3" }
+ ListElement { text: "4" }
+ ListElement { text: "5" }
+ ListElement { text: "6" }
+ ListElement { text: "7" }
+ ListElement { text: "8" }
+ ListElement { text: "9" }
+ }
+
+ readonly property Item topItem: itemAt(0, contentY)
+ onTopItemChanged: model.append({ "text": "new" })
+}
diff --git a/tests/auto/quick/qquicklistview/data/qtbug34576.qml b/tests/auto/quick/qquicklistview/data/qtbug34576.qml
new file mode 100644
index 0000000000..f407d8ebe3
--- /dev/null
+++ b/tests/auto/quick/qquicklistview/data/qtbug34576.qml
@@ -0,0 +1,102 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+import QtQuick 2.7
+
+Rectangle {
+ id: root
+ width: 320
+ height: 240
+ color: "black"
+
+ property int current: list.currentIndex
+ property int horizontalVelocityZeroCount: 0
+
+ ListView {
+ id: list
+ objectName: "list"
+ anchors.fill: parent
+
+ focus: true
+
+ orientation: ListView.Horizontal
+
+ snapMode: ListView.SnapToItem
+ flickableDirection: Flickable.HorizontalFlick
+
+ model: 10
+ delegate: Item {
+ width: root.width / 3
+ height: root.height
+ Rectangle {
+ anchors.centerIn: parent
+ width: 50
+ height: 50
+ color: list.currentIndex === index ? "red" : "white"
+ }
+ }
+
+ onHorizontalVelocityChanged: {
+ if (list.horizontalVelocity === 0.0)
+ root.horizontalVelocityZeroCount++
+ }
+
+ }
+
+ Rectangle {
+ color: "red"
+ width: 50
+ height: 50
+ anchors.left: parent.left
+ anchors.bottom: parent.bottom
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ list.currentIndex--;
+ }
+ }
+ }
+
+ Rectangle {
+ color: "red"
+ width: 50
+ height: 50
+ anchors.right: parent.right
+ anchors.bottom: parent.bottom
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ list.currentIndex++;
+ }
+ }
+ }
+}
+
diff --git a/tests/auto/quick/qquicklistview/data/qtbug63974.qml b/tests/auto/quick/qquicklistview/data/qtbug63974.qml
new file mode 100644
index 0000000000..1e0afa54f8
--- /dev/null
+++ b/tests/auto/quick/qquicklistview/data/qtbug63974.qml
@@ -0,0 +1,34 @@
+import QtQuick 2.6
+
+ListView {
+ id: table
+ height: 200
+ width: 100
+
+ headerPositioning: ListView.OverlayHeader
+ header: Rectangle {
+ width: table.width
+ height: 20
+ color: "red"
+ z: 100
+ }
+
+ footerPositioning: ListView.OverlayFooter
+ footer: Rectangle {
+ width: table.width
+ height: 20
+ color: "blue"
+ z: 200
+ }
+
+ model: 30
+ delegate: Rectangle {
+ height: 20
+ width: table.width
+ color: "lightgray"
+ Text {
+ text: "Item " + index
+ anchors.centerIn: parent
+ }
+ }
+}