diff options
| author | Mitch Curtis <mitch.curtis@qt.io> | 2024-04-10 15:14:52 +0800 |
|---|---|---|
| committer | Mitch Curtis <mitch.curtis@qt.io> | 2024-12-24 19:23:43 +0800 |
| commit | 0794a0e06e40703b191ea3af5ddbb14fafafea8e (patch) | |
| tree | e572ba132631d899eb4524fa97d6b4a12daedeed /src/quickcontrols/basic/qtquickcontrols2basicforeign_p.h | |
| parent | 23ed52c1c0f68a95d96beb060548e90d18407601 (diff) | |
Add ContextMenu
This is an attached type that provides a way to open a context menu
in a platform-appropriate manner.
[ChangeLog][Controls] Added ContextMenu. ContextMenu can be attached
to any item in order to show a context menu upon a platform-specific
event, such as a right click or the context menu key.
Fixes: QTBUG-67331
Pick-to: 6.9
Change-Id: I225a8f498cc5bc18d36c3dc4cf481ef5ef95cd88
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/quickcontrols/basic/qtquickcontrols2basicforeign_p.h')
| -rw-r--r-- | src/quickcontrols/basic/qtquickcontrols2basicforeign_p.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/quickcontrols/basic/qtquickcontrols2basicforeign_p.h b/src/quickcontrols/basic/qtquickcontrols2basicforeign_p.h index 203a1c69a3..78f26b375b 100644 --- a/src/quickcontrols/basic/qtquickcontrols2basicforeign_p.h +++ b/src/quickcontrols/basic/qtquickcontrols2basicforeign_p.h @@ -4,6 +4,7 @@ #define QTQUICKCONTROLS2BASICFOREIGN_P_H #include <QtQml/qqml.h> +#include <QtQuickTemplates2/private/qquickcontextmenu_p.h> #include <QtQuickTemplates2/private/qquickoverlay_p.h> #if QT_CONFIG(quicktemplates2_container) #include <QtQuickTemplates2/private/qquicksplitview_p.h> @@ -46,6 +47,15 @@ struct QQuickSplitHandleAttachedForeign }; #endif +struct QQuickContextMenuForeign +{ + Q_GADGET + QML_NAMED_ELEMENT(ContextMenu) + QML_FOREIGN(QQuickContextMenu) + QML_UNCREATABLE("") + QML_ADDED_IN_VERSION(6, 8) +}; + QT_END_NAMESPACE #endif // QTQUICKCONTROLS2BASICFOREIGN_P_H |
