diff options
Diffstat (limited to 'src/quickcontrols/doc/snippets/qtquickcontrols-contextmenu.qml')
| -rw-r--r-- | src/quickcontrols/doc/snippets/qtquickcontrols-contextmenu.qml | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/quickcontrols/doc/snippets/qtquickcontrols-contextmenu.qml b/src/quickcontrols/doc/snippets/qtquickcontrols-contextmenu.qml new file mode 100644 index 0000000000..f84de499cb --- /dev/null +++ b/src/quickcontrols/doc/snippets/qtquickcontrols-contextmenu.qml @@ -0,0 +1,25 @@ +// Copyright (C) 2025 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +import QtQuick.Controls + +//! [root] +Pane { + anchors.fill: parent + + ContextMenu.menu: Menu { + MenuItem { + text: qsTr("Eat Tomato") + onTriggered: { /* ... */ } + } + MenuItem { + text: qsTr("Throw Tomato") + onTriggered: { /* ... */ } + } + MenuItem { + text: qsTr("Squash Tomato") + onTriggered: { /* ... */ } + } + } +} +//! [root] |
