diff options
Diffstat (limited to 'tests/auto/quickcontrols2/qquickmenu/data/customMenuUseRepeaterAsTheContentItem.qml')
-rw-r--r-- | tests/auto/quickcontrols2/qquickmenu/data/customMenuUseRepeaterAsTheContentItem.qml | 65 |
1 files changed, 65 insertions, 0 deletions
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 + } + } + } +} |