diff options
Diffstat (limited to 'tests/auto/extras/data/PieMenu3ItemsKeepOpen.qml')
-rw-r--r-- | tests/auto/extras/data/PieMenu3ItemsKeepOpen.qml | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/tests/auto/extras/data/PieMenu3ItemsKeepOpen.qml b/tests/auto/extras/data/PieMenu3ItemsKeepOpen.qml new file mode 100644 index 00000000..ffbfa20a --- /dev/null +++ b/tests/auto/extras/data/PieMenu3ItemsKeepOpen.qml @@ -0,0 +1,54 @@ +import QtQuick 2.2 +import QtQuick.Controls 1.1 +import QtQuick.Extras 1.3 + +Rectangle { + id: rect + anchors.fill: parent + + signal actionTriggered(int index) + + property alias mouseArea: area + + MouseArea { + id: area + anchors.fill: parent + acceptedButtons: Qt.LeftButton + onClicked: pieMenu.popup(mouseX, mouseY); + } + + property alias pieMenu: menu + + PieMenu { + id: menu + width: 200 + height: 200 + + MenuItem { + text: "Action 1" + onTriggered: { + menu.visible = true; + actionTriggered(0); + } + } + MenuItem { + text: "Action 2" + onTriggered: { + menu.visible = true; + actionTriggered(1); + } + } + MenuItem { + text: "Action 3" + onTriggered: { + menu.visible = true; + actionTriggered(2); + } + } + } + Rectangle { + anchors.fill: menu + color: "transparent" + border.color: "black" + } +} |