aboutsummaryrefslogtreecommitdiffstats
path: root/tests/manual/testbench/main.qml
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@theqtcompany.com>2015-11-16 16:06:07 +0100
committerJ-P Nurmi <jpnurmi@theqtcompany.com>2015-12-02 16:16:31 +0000
commitb185fc1ac02d4887d2b187a4043b1fdedb95305e (patch)
tree9650c29786a86d7272541702d59cfa285216f7f0 /tests/manual/testbench/main.qml
parent5823d6230f5b1fbbd27c3b00b334e062a21b3d65 (diff)
Add Menu
An item-based menu derived from QQuickPanel. Eventually we'd like to make Panel itself a QQuickItem, as it makes both the implementation and the actual usage of Menu a lot easier. Change-Id: Ic1bf2a05ab98d9e17824c402ed8326ef65d26c69 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Diffstat (limited to 'tests/manual/testbench/main.qml')
-rw-r--r--tests/manual/testbench/main.qml17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/manual/testbench/main.qml b/tests/manual/testbench/main.qml
index 6f842c9c..b375a098 100644
--- a/tests/manual/testbench/main.qml
+++ b/tests/manual/testbench/main.qml
@@ -62,6 +62,7 @@ ApplicationWindow {
ToolButton {
text: "Normal"
+ onClicked: menu.visible ? menu.hide() : menu.show()
}
ToolButton {
text: "Pressed"
@@ -97,6 +98,22 @@ ApplicationWindow {
}
}
+ Menu {
+ id: menu
+ contentItem.x: 1
+ contentItem.y: header.height
+
+ MenuItem {
+ text: "Option 1"
+ }
+ MenuItem {
+ text: "Option 2"
+ }
+ MenuItem {
+ text: "Option 3"
+ }
+ }
+
Flickable {
anchors.fill: parent
topMargin: 30