aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quickcontrols2/qquickmenu/data
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/quickcontrols2/qquickmenu/data')
-rw-r--r--tests/auto/quickcontrols2/qquickmenu/data/customMenuCullItems.qml55
-rw-r--r--tests/auto/quickcontrols2/qquickmenu/data/customMenuUseRepeaterAsTheContentItem.qml65
-rw-r--r--tests/auto/quickcontrols2/qquickmenu/data/subMenus.qml3
3 files changed, 123 insertions, 0 deletions
diff --git a/tests/auto/quickcontrols2/qquickmenu/data/customMenuCullItems.qml b/tests/auto/quickcontrols2/qquickmenu/data/customMenuCullItems.qml
new file mode 100644
index 0000000000..0f56ecdd87
--- /dev/null
+++ b/tests/auto/quickcontrols2/qquickmenu/data/customMenuCullItems.qml
@@ -0,0 +1,55 @@
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
+
+ApplicationWindow {
+ width: 200
+ height: 200
+ property alias menu: menu
+
+ Menu {
+ id: menu
+
+ contentItem: FocusScope {
+ implicitHeight: view.implicitHeight
+ Button {
+ anchors {
+ top: parent.top
+ topMargin: 5
+ horizontalCenter: parent.horizontalCenter
+ }
+ z: 1
+ text: "Button Up"
+ visible: view.interactive
+ }
+ ListView {
+ id: view
+ width: parent.width
+ implicitHeight: Math.min(contentHeight, 300)
+ model: menu.contentModel
+
+ clip: true
+ currentIndex: menu.currentIndex
+ ScrollIndicator.vertical: ScrollIndicator {}
+ }
+ Button {
+ anchors {
+ bottom: parent.bottom
+ bottomMargin: 5
+ horizontalCenter: parent.horizontalCenter
+ }
+ z: 1
+ text: "Button Down"
+ visible: view.interactive
+ }
+ }
+
+ Repeater {
+ model: 20
+ MenuItem {
+ objectName: "Item: " + modelData
+ text: objectName
+ }
+ }
+ }
+}
diff --git a/tests/auto/quickcontrols2/qquickmenu/data/customMenuUseRepeaterAsTheContentItem.qml b/tests/auto/quickcontrols2/qquickmenu/data/customMenuUseRepeaterAsTheContentItem.qml
new file mode 100644
index 0000000000..bfa8f66be5
--- /dev/null
+++ b/tests/auto/quickcontrols2/qquickmenu/data/customMenuUseRepeaterAsTheContentItem.qml
@@ -0,0 +1,65 @@
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
+
+ApplicationWindow {
+ width: 200
+ height: 200
+ property alias menu: menu
+
+ Menu {
+ id: menu
+ visible: true
+
+ contentItem: FocusScope {
+ implicitHeight: flickable.height
+
+ Button {
+ anchors {
+ top: parent.top
+ topMargin: 5
+ horizontalCenter: parent.horizontalCenter
+ }
+ z: 1
+ text: "Button Up"
+ }
+
+ Flickable {
+ id: flickable
+ width: parent.width
+ height: Math.min(contentHeight, 300)
+ contentHeight: repeaterLayout.implicitHeight
+ clip: true
+
+ ScrollIndicator.vertical: ScrollIndicator {}
+
+ ColumnLayout {
+ id: repeaterLayout
+ width: parent.width
+
+ Repeater {
+ model: menu.contentModel
+ }
+ }
+ }
+
+ Button {
+ anchors {
+ bottom: parent.bottom
+ bottomMargin: 5
+ horizontalCenter: parent.horizontalCenter
+ }
+ z: 1
+ text: "Button Down"
+ }
+ }
+
+ Repeater {
+ model: 20
+ MenuItem {
+ objectName: "Item: " + modelData
+ text: objectName
+ }
+ }
+ }
+}
diff --git a/tests/auto/quickcontrols2/qquickmenu/data/subMenus.qml b/tests/auto/quickcontrols2/qquickmenu/data/subMenus.qml
index fad59ee6d1..8227a29fb2 100644
--- a/tests/auto/quickcontrols2/qquickmenu/data/subMenus.qml
+++ b/tests/auto/quickcontrols2/qquickmenu/data/subMenus.qml
@@ -69,6 +69,7 @@ ApplicationWindow {
}
Menu {
+ overlap: 0
id: subMenu1
objectName: "subMenu1"
title: "Sub Menu 1"
@@ -78,6 +79,7 @@ ApplicationWindow {
objectName: "subMenuItem1"
text: "Sub 1"
}
+
MenuItem {
id: subMenuItem2
objectName: "subMenuItem2"
@@ -85,6 +87,7 @@ ApplicationWindow {
}
Menu {
+ overlap: 0
id: subSubMenu1
objectName: "subSubMenu1"
title: "Sub Sub Menu 1"