|
static QQuickContextMenuPrivate * | get (QQuickContextMenu *attachedObject) |
static QQuickContextMenuPrivate * | get (QQuickContextMenu *attachedObject) |
static bool | removeConnection (Connection *c) |
static QObjectPrivate * | get (QObject *o) |
static const QObjectPrivate * | get (const QObject *o) |
template<typename Func1, typename Func2> |
static QMetaObject::Connection | connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiverPrivate, Func2 slot, Qt::ConnectionType type=Qt::AutoConnection) |
template<typename Func1, typename Func2> |
static bool | disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiverPrivate, Func2 slot) |
static QMetaObject::Connection | connectImpl (const QObject *sender, int signal_index, const QObject *receiver, void **slot, QtPrivate::QSlotObjectBase *slotObj, int type, const int *types, const QMetaObject *senderMetaObject) |
static QMetaObject::Connection | connect (const QObject *sender, int signal_index, QtPrivate::QSlotObjectBase *slotObj, Qt::ConnectionType type) |
static QMetaObject::Connection | connect (const QObject *sender, int signal_index, const QObject *receiver, QtPrivate::QSlotObjectBase *slotObj, Qt::ConnectionType type) |
static bool | disconnect (const QObject *sender, int signal_index, void **slot) |
static bool | disconnect (const QObject *sender, int signal_index, const QObject *receiver, void **slot) |
\qmltype ContextMenu
The ContextMenu attached type provides a way to open a context menu in a platform-appropriate manner. \inqmlmodule QtQuick.Controls
- Since
- 6.9
ContextMenu can be attached to any \l {QQuickItem}{item} in order to show a context menu upon a platform-specific event, such as a right click or the context menu key.
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: { /* ... */ }
}
}
}
Definition at line 86 of file qquickcontextmenu.cpp.