aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquicklistview/data/clickHeaderAndFooterWhenClip.qml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/quick/qquicklistview/data/clickHeaderAndFooterWhenClip.qml')
-rw-r--r--tests/auto/quick/qquicklistview/data/clickHeaderAndFooterWhenClip.qml60
1 files changed, 60 insertions, 0 deletions
diff --git a/tests/auto/quick/qquicklistview/data/clickHeaderAndFooterWhenClip.qml b/tests/auto/quick/qquicklistview/data/clickHeaderAndFooterWhenClip.qml
new file mode 100644
index 0000000000..c48e2d47d1
--- /dev/null
+++ b/tests/auto/quick/qquicklistview/data/clickHeaderAndFooterWhenClip.qml
@@ -0,0 +1,60 @@
+import QtQuick 2.9
+import QtQuick.Window 2.15
+
+ListView {
+ id: list
+ anchors.fill: parent
+ property bool headerPressed: false
+ property bool footerPressed: false
+ model: ListModel {
+ ListElement {
+ name: "Element 1"
+ }
+ ListElement {
+ name: "Element 2"
+ }
+ ListElement {
+ name: "Element 3"
+ }
+ ListElement {
+ name: "Element 4"
+ }
+ ListElement {
+ name: "Element 5"
+ }
+ ListElement {
+ name: "Element 6"
+ }
+ }
+ clip: true
+ headerPositioning: ListView.OverlayHeader
+ footerPositioning: ListView.OverlayHeader
+
+ delegate: Text {
+ height: 100
+ text: name
+ }
+
+ header: Rectangle {
+ width: parent.width
+ height: 50
+ z: 2
+ color: "blue"
+ MouseArea {
+ objectName: "header"
+ anchors.fill: parent
+ onClicked: list.headerPressed = true
+ }
+ }
+ footer: Rectangle {
+ width: parent.width
+ height: 50
+ color: "red"
+ z: 2
+ MouseArea {
+ objectName: "footer"
+ anchors.fill: parent
+ onClicked: list.footerPressed = true
+ }
+ }
+}