Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QQuickLabsPlatformMenu Class Reference

#include <qquicklabsplatformmenu_p.h>

+ Inheritance diagram for QQuickLabsPlatformMenu:
+ Collaboration diagram for QQuickLabsPlatformMenu:

Public Slots

void open (QQmlV4FunctionPtr args)
 \qmlmethod void Qt.labs.platform::Menu::open(MenuItem item)
 
void close ()
 \qmlmethod void Qt.labs.platform::Menu::close()
 
- Public Slots inherited from QObject
void deleteLater ()
 \threadsafe
 

Signals

void aboutToShow ()
 
void aboutToHide ()
 
void itemsChanged ()
 
void menuBarChanged ()
 
void parentMenuChanged ()
 
void systemTrayIconChanged ()
 
void titleChanged ()
 
void enabledChanged ()
 
void visibleChanged ()
 
void minimumWidthChanged ()
 
void fontChanged ()
 
void typeChanged ()
 
 Q_REVISION (2, 1) void iconChanged()
 
- Signals inherited from QObject
void destroyed (QObject *=nullptr)
 This signal is emitted immediately before the object obj is destroyed, after any instances of QPointer have been notified, and cannot be blocked.
 
void objectNameChanged (const QString &objectName, QPrivateSignal)
 This signal is emitted after the object's name has been changed.
 

Public Member Functions

 QQuickLabsPlatformMenu (QObject *parent=nullptr)
 A native menu.
 
 ~QQuickLabsPlatformMenu ()
 
QPlatformMenuhandle () const
 
QPlatformMenucreate ()
 
void destroy ()
 
void sync ()
 
QQmlListProperty< QObjectdata ()
 
QQmlListProperty< QQuickLabsPlatformMenuItemitems ()
 
QQuickLabsPlatformMenuBarmenuBar () const
 \readonly \qmlproperty MenuBar Qt.labs.platform::Menu::menuBar
 
void setMenuBar (QQuickLabsPlatformMenuBar *menuBar)
 
QQuickLabsPlatformMenuparentMenu () const
 \readonly \qmlproperty Menu Qt.labs.platform::Menu::parentMenu
 
void setParentMenu (QQuickLabsPlatformMenu *menu)
 
QQuickLabsPlatformMenuItemmenuItem () const
 \readonly \qmlproperty MenuItem Qt.labs.platform::Menu::menuItem
 
bool isEnabled () const
 \qmlproperty bool Qt.labs.platform::Menu::enabled
 
void setEnabled (bool enabled)
 
bool isVisible () const
 \qmlproperty bool Qt.labs.platform::Menu::visible
 
void setVisible (bool visible)
 
int minimumWidth () const
 \qmlproperty int Qt.labs.platform::Menu::minimumWidth
 
void setMinimumWidth (int width)
 
QPlatformMenu::MenuType type () const
 \qmlproperty enumeration Qt.labs.platform::Menu::type
 
void setType (QPlatformMenu::MenuType type)
 
QString title () const
 \qmlproperty string Qt.labs.platform::Menu::title
 
void setTitle (const QString &title)
 
QFont font () const
 \qmlproperty font Qt.labs.platform::Menu::font
 
void setFont (const QFont &font)
 
QQuickLabsPlatformIcon icon () const
 
void setIcon (const QQuickLabsPlatformIcon &icon)
 
Q_INVOKABLE void addItem (QQuickLabsPlatformMenuItem *item)
 \qmlmethod void Qt.labs.platform::Menu::addItem(MenuItem item)
 
Q_INVOKABLE void insertItem (int index, QQuickLabsPlatformMenuItem *item)
 \qmlmethod void Qt.labs.platform::Menu::insertItem(int index, MenuItem item)
 
Q_INVOKABLE void removeItem (QQuickLabsPlatformMenuItem *item)
 \qmlmethod void Qt.labs.platform::Menu::removeItem(MenuItem item)
 
Q_INVOKABLE void addMenu (QQuickLabsPlatformMenu *menu)
 \qmlmethod void Qt.labs.platform::Menu::addMenu(Menu submenu)
 
Q_INVOKABLE void insertMenu (int index, QQuickLabsPlatformMenu *menu)
 \qmlmethod void Qt.labs.platform::Menu::insertMenu(int index, Menu submenu)
 
Q_INVOKABLE void removeMenu (QQuickLabsPlatformMenu *menu)
 \qmlmethod void Qt.labs.platform::Menu::removeMenu(Menu submenu)
 
Q_INVOKABLE void clear ()
 \qmlmethod void Qt.labs.platform::Menu::clear()
 
- Public Member Functions inherited from QObject
Q_INVOKABLE QObject (QObject *parent=nullptr)
 Constructs an object with parent object parent.
 
virtual ~QObject ()
 Destroys the object, deleting all its child objects.
 
virtual bool event (QEvent *event)
 This virtual function receives events to an object and should return true if the event e was recognized and processed.
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 Filters events if this object has been installed as an event filter for the watched object.
 
QString objectName () const
 
Q_WEAK_OVERLOAD void setObjectName (const QString &name)
 Sets the object's name to name.
 
void setObjectName (QAnyStringView name)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
QBindable< QStringbindableObjectName ()
 
bool isWidgetType () const
 Returns true if the object is a widget; otherwise returns false.
 
bool isWindowType () const
 Returns true if the object is a window; otherwise returns false.
 
bool isQuickItemType () const
 Returns true if the object is a QQuickItem; otherwise returns false.
 
bool signalsBlocked () const noexcept
 Returns true if signals are blocked; otherwise returns false.
 
bool blockSignals (bool b) noexcept
 If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke anything connected to it).
 
QThreadthread () const
 Returns the thread in which the object lives.
 
bool moveToThread (QThread *thread QT6_DECL_NEW_OVERLOAD_TAIL)
 Changes the thread affinity for this object and its children and returns true on success.
 
int startTimer (int interval, Qt::TimerType timerType=Qt::CoarseTimer)
 This is an overloaded function that will start a timer of type timerType and a timeout of interval milliseconds.
 
int startTimer (std::chrono::nanoseconds time, Qt::TimerType timerType=Qt::CoarseTimer)
 
void killTimer (int id)
 Kills the timer with timer identifier, id.
 
void killTimer (Qt::TimerId id)
 
template<typename T >
findChild (QAnyStringView aName, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 Returns the child of this object that can be cast into type T and that is called name, or \nullptr if there is no such object.
 
template<typename T >
QList< T > findChildren (QAnyStringView aName, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects.
 
template<typename T >
findChild (Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename T >
QList< T > findChildren (Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
const QObjectListchildren () const
 Returns a list of child objects.
 
void setParent (QObject *parent)
 Makes the object a child of parent.
 
void installEventFilter (QObject *filterObj)
 Installs an event filter filterObj on this object.
 
void removeEventFilter (QObject *obj)
 Removes an event filter object obj from this object.
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const
 
bool disconnect (const char *signal=nullptr, const QObject *receiver=nullptr, const char *member=nullptr) const
 
bool disconnect (const QObject *receiver, const char *member=nullptr) const
 
void dumpObjectTree () const
 Dumps a tree of children to the debug output.
 
void dumpObjectInfo () const
 Dumps information about signal connections, etc.
 
bool setProperty (const char *name, const QVariant &value)
 Sets the value of the object's name property to value.
 
bool setProperty (const char *name, QVariant &&value)
 
QVariant property (const char *name) const
 Returns the value of the object's name property.
 
QList< QByteArraydynamicPropertyNames () const
 
QBindingStoragebindingStorage ()
 
const QBindingStoragebindingStorage () const
 
QObjectparent () const
 Returns a pointer to the parent object.
 
bool inherits (const char *classname) const
 Returns true if this object is an instance of a class that inherits className or a QObject subclass that inherits className; otherwise returns false.
 
- Public Member Functions inherited from QQmlParserStatus
 QQmlParserStatus ()
 
virtual ~QQmlParserStatus ()
 

Protected Member Functions

void classBegin () override
 Invoked after class creation, but before any properties have been set.
 
void componentComplete () override
 Invoked after the root component that caused this instantiation has completed construction.
 
QQuickLabsPlatformIconLoadericonLoader () const
 
QWindowfindWindow (QQuickItem *target, QPoint *offset) const
 
- Protected Member Functions inherited from QObject
QObjectsender () const
 Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; otherwise it returns \nullptr.
 
int senderSignalIndex () const
 
int receivers (const char *signal) const
 Returns the number of receivers connected to the signal.
 
bool isSignalConnected (const QMetaMethod &signal) const
 
virtual void timerEvent (QTimerEvent *event)
 This event handler can be reimplemented in a subclass to receive timer events for the object.
 
virtual void childEvent (QChildEvent *event)
 This event handler can be reimplemented in a subclass to receive child events.
 
virtual void customEvent (QEvent *event)
 This event handler can be reimplemented in a subclass to receive custom events.
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 
 QObject (QObjectPrivate &dd, QObject *parent=nullptr)
 

Static Protected Member Functions

static void data_append (QQmlListProperty< QObject > *property, QObject *object)
 
static qsizetype data_count (QQmlListProperty< QObject > *property)
 
static QObjectdata_at (QQmlListProperty< QObject > *property, qsizetype index)
 
static void data_clear (QQmlListProperty< QObject > *property)
 
static void items_append (QQmlListProperty< QQuickLabsPlatformMenuItem > *property, QQuickLabsPlatformMenuItem *item)
 
static qsizetype items_count (QQmlListProperty< QQuickLabsPlatformMenuItem > *property)
 
static QQuickLabsPlatformMenuItemitems_at (QQmlListProperty< QQuickLabsPlatformMenuItem > *property, qsizetype index)
 
static void items_clear (QQmlListProperty< QQuickLabsPlatformMenuItem > *property)
 

Properties

QQmlListProperty< QObjectdata
 \qmldefault \qmlproperty list<QtObject> Qt.labs.platform::Menu::data
 
QQmlListProperty< QQuickLabsPlatformMenuItemitems
 \qmlproperty list<MenuItem> Qt.labs.platform::Menu::items
 
QQuickLabsPlatformMenuBarmenuBar
 
QQuickLabsPlatformMenuparentMenu
 
QQuickLabsPlatformMenuItemmenuItem
 
bool enabled
 
bool visible
 
int minimumWidth
 
QPlatformMenu::MenuType type
 
QString title
 
QFont font
 
QQuickLabsPlatformIcon icon
 
- Properties inherited from QObject
QString objectName
 the name of this object
 

Additional Inherited Members

- Static Public Member Functions inherited from QObject
static QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
 \threadsafe
 
static QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type=Qt::AutoConnection)
 
template<typename Func1 , typename Func2 >
static QMetaObject::Connection connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::ContextTypeForFunctor< Func2 >::ContextType *context, Func2 &&slot, Qt::ConnectionType type=Qt::AutoConnection)
 
template<typename Func1 , typename Func2 >
static QMetaObject::Connection connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, Func2 &&slot)
 
static bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member)
 \threadsafe
 
static bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &member)
 
static bool disconnect (const QMetaObject::Connection &)
 Disconnect a connection.
 
template<typename Func1 , typename Func2 >
static bool disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiver, Func2 slot)
 
template<typename Func1 >
static bool disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const QObject *receiver, void **zero)
 
- Protected Attributes inherited from QObject
QScopedPointer< QObjectDatad_ptr
 

Detailed Description

Definition at line 39 of file qquicklabsplatformmenu_p.h.

Constructor & Destructor Documentation

◆ QQuickLabsPlatformMenu()

QT_BEGIN_NAMESPACE QQuickLabsPlatformMenu::QQuickLabsPlatformMenu ( QObject * parent = nullptr)
explicit

A native menu.

\qmltype Menu
\inherits QtObject

! \instantiates QQuickLabsPlatformMenu \inqmlmodule Qt.labs.platform

Since
5.8

The Menu type provides a QML API for native platform menu popups.

Menu can be used in a \l MenuBar, or as a stand-alone context menu. The following example shows how to open a context menu on right mouse click:

MouseArea {
acceptedButtons: Qt.RightButton
onClicked: zoomMenu.open()
}
Menu {
id: zoomMenu
MenuItem {
text: qsTr("Zoom In")
shortcut: StandardKey.ZoomIn
onTriggered: zoomIn()
}
MenuItem {
text: qsTr("Zoom Out")
shortcut: StandardKey.ZoomOut
onTriggered: zoomOut()
}
}
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:346
QQuickItem * fill
QString text
Definition qcompare.h:63
GLenum GLuint id
[7]
QQuickAnchors * anchors(QQuickItem *item)

Definition at line 134 of file qquicklabsplatformmenu.cpp.

◆ ~QQuickLabsPlatformMenu()

QQuickLabsPlatformMenu::~QQuickLabsPlatformMenu ( )

Definition at line 150 of file qquicklabsplatformmenu.cpp.

References removeMenu(), and QQuickLabsPlatformMenuBar::removeMenu().

+ Here is the call graph for this function:

Member Function Documentation

◆ aboutToHide

void QQuickLabsPlatformMenu::aboutToHide ( )
signal

Referenced by create().

+ Here is the caller graph for this function:

◆ aboutToShow

void QQuickLabsPlatformMenu::aboutToShow ( )
signal

Referenced by create().

+ Here is the caller graph for this function:

◆ addItem()

void QQuickLabsPlatformMenu::addItem ( QQuickLabsPlatformMenuItem * item)

\qmlmethod void Qt.labs.platform::Menu::addItem(MenuItem item)

Adds an item to the end of the menu.

Definition at line 537 of file qquicklabsplatformmenu.cpp.

References insertItem(), item, and QList< T >::size().

+ Here is the call graph for this function:

◆ addMenu()

void QQuickLabsPlatformMenu::addMenu ( QQuickLabsPlatformMenu * menu)

\qmlmethod void Qt.labs.platform::Menu::addMenu(Menu submenu)

Adds a submenu to the end of the menu.

Definition at line 586 of file qquicklabsplatformmenu.cpp.

References insertMenu(), menu, and QList< T >::size().

+ Here is the call graph for this function:

◆ classBegin()

void QQuickLabsPlatformMenu::classBegin ( )
overrideprotectedvirtual

Invoked after class creation, but before any properties have been set.

Implements QQmlParserStatus.

Definition at line 713 of file qquicklabsplatformmenu.cpp.

◆ clear()

void QQuickLabsPlatformMenu::clear ( )

\qmlmethod void Qt.labs.platform::Menu::clear()

Removes all items from the menu.

Definition at line 624 of file qquicklabsplatformmenu.cpp.

References QList< T >::clear(), emit, QList< T >::isEmpty(), item, itemsChanged(), QPlatformMenu::removeMenuItem(), QList< T >::removeOne(), and sync().

+ Here is the call graph for this function:

◆ close

void QQuickLabsPlatformMenu::close ( )
slot

\qmlmethod void Qt.labs.platform::Menu::close()

Closes the menu.

Definition at line 707 of file qquicklabsplatformmenu.cpp.

References QPlatformMenu::dismiss().

+ Here is the call graph for this function:

◆ componentComplete()

void QQuickLabsPlatformMenu::componentComplete ( )
overrideprotectedvirtual

Invoked after the root component that caused this instantiation has completed construction.

At this point all static values and binding values have been assigned to the class.

Implements QQmlParserStatus.

Definition at line 717 of file qquicklabsplatformmenu.cpp.

References QQuickLabsPlatformIconLoader::setEnabled(), and sync().

+ Here is the call graph for this function:

◆ create()

QPlatformMenu * QQuickLabsPlatformMenu::create ( )

Definition at line 179 of file qquicklabsplatformmenu.cpp.

References QPlatformMenu::aboutToHide(), aboutToHide(), QPlatformMenu::aboutToShow(), aboutToShow(), QObject::connect(), QQuickLabsPlatformMenuItem::create(), QPlatformMenuBar::createMenu(), QPlatformSystemTrayIcon::createMenu(), QWidgetPlatform::createMenu(), QPlatformMenu::createSubMenu(), handle(), QQuickLabsPlatformMenuBar::handle(), QQuickLabsPlatformSystemTrayIcon::handle(), QPlatformMenu::insertMenuItem(), item, QGuiApplicationPrivate::platformTheme(), and qCDebug.

Referenced by QQuickLabsPlatformSystemTrayIcon::init(), QQuickLabsPlatformSystemTrayIcon::setMenu(), and sync().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ data()

QQmlListProperty< QObject > QQuickLabsPlatformMenu::data ( )

◆ data_append()

void QQuickLabsPlatformMenu::data_append ( QQmlListProperty< QObject > * property,
QObject * object )
staticprotected

Definition at line 770 of file qquicklabsplatformmenu.cpp.

References QMenu::addMenu(), item, and menu.

+ Here is the call graph for this function:

◆ data_at()

QObject * QQuickLabsPlatformMenu::data_at ( QQmlListProperty< QObject > * property,
qsizetype index )
staticprotected

Definition at line 787 of file qquicklabsplatformmenu.cpp.

References menu.

◆ data_clear()

void QQuickLabsPlatformMenu::data_clear ( QQmlListProperty< QObject > * property)
staticprotected

Definition at line 793 of file qquicklabsplatformmenu.cpp.

References QMenu::clear(), and menu.

+ Here is the call graph for this function:

◆ data_count()

qsizetype QQuickLabsPlatformMenu::data_count ( QQmlListProperty< QObject > * property)
staticprotected

Definition at line 781 of file qquicklabsplatformmenu.cpp.

References menu, and QWidget::size.

◆ destroy()

void QQuickLabsPlatformMenu::destroy ( )

Definition at line 219 of file qquicklabsplatformmenu.cpp.

Referenced by setMenuBar(), and setParentMenu().

+ Here is the caller graph for this function:

◆ enabledChanged

void QQuickLabsPlatformMenu::enabledChanged ( )
signal

Referenced by setEnabled().

+ Here is the caller graph for this function:

◆ findWindow()

QWindow * QQuickLabsPlatformMenu::findWindow ( QQuickItem * target,
QPoint * offset ) const
protected

Definition at line 747 of file qquicklabsplatformmenu.cpp.

References effectiveWindow(), item, QObject::parent(), qobject_cast< QQuickItem * >(), qobject_cast< QWindow * >(), window(), QGraphicsItem::window(), and QQuickLabsPlatformMenuBar::window.

Referenced by open().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ font()

QFont QQuickLabsPlatformMenu::font ( ) const

\qmlproperty font Qt.labs.platform::Menu::font

This property holds the menu's font.

See also
title

Definition at line 489 of file qquicklabsplatformmenu.cpp.

◆ fontChanged

void QQuickLabsPlatformMenu::fontChanged ( )
signal

Referenced by setFont().

+ Here is the caller graph for this function:

◆ handle()

QPlatformMenu * QQuickLabsPlatformMenu::handle ( ) const

Definition at line 174 of file qquicklabsplatformmenu.cpp.

Referenced by create(), QQuickLabsPlatformMenuItem::create(), QQuickLabsPlatformSystemTrayIcon::init(), QQuickLabsPlatformMenuBar::insertMenu(), QQuickLabsPlatformSystemTrayIcon::setMenu(), and QQuickLabsPlatformMenuItem::sync().

+ Here is the caller graph for this function:

◆ icon()

QQuickLabsPlatformIcon QQuickLabsPlatformMenu::icon ( ) const
Since
Qt.labs.platform 1.1 (Qt 5.12) \qmlproperty url Qt.labs.platform::Menu::icon.source \qmlproperty string Qt.labs.platform::Menu::icon.name \qmlproperty bool Qt.labs.platform::Menu::icon.mask

This property holds the menu item's icon.

Definition at line 512 of file qquicklabsplatformmenu.cpp.

References QQuickLabsPlatformIconLoader::icon(), and iconLoader().

+ Here is the call graph for this function:

◆ iconLoader()

QQuickLabsPlatformIconLoader * QQuickLabsPlatformMenu::iconLoader ( ) const
protected

Definition at line 725 of file qquicklabsplatformmenu.cpp.

References QQuickLabsPlatformIconLoader::setEnabled().

Referenced by icon(), and setIcon().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ insertItem()

void QQuickLabsPlatformMenu::insertItem ( int index,
QQuickLabsPlatformMenuItem * item )

\qmlmethod void Qt.labs.platform::Menu::insertItem(int index, MenuItem item)

Inserts an item at the specified index in the menu.

Definition at line 547 of file qquicklabsplatformmenu.cpp.

References QList< T >::append(), QListSpecialMethodsBase< T >::contains(), QQuickLabsPlatformMenuItem::create(), emit, QList< T >::insert(), QPlatformMenu::insertMenuItem(), item, itemsChanged(), sync(), and QList< T >::value().

Referenced by addItem(), and insertMenu().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ insertMenu()

void QQuickLabsPlatformMenu::insertMenu ( int index,
QQuickLabsPlatformMenu * menu )

\qmlmethod void Qt.labs.platform::Menu::insertMenu(int index, Menu submenu)

Inserts a submenu at the specified index in the menu.

Definition at line 596 of file qquicklabsplatformmenu.cpp.

References insertItem(), and menu.

Referenced by addMenu().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isEnabled()

bool QQuickLabsPlatformMenu::isEnabled ( ) const

\qmlproperty bool Qt.labs.platform::Menu::enabled

This property holds whether the menu is enabled. The default value is true.

Definition at line 374 of file qquicklabsplatformmenu.cpp.

◆ isVisible()

bool QQuickLabsPlatformMenu::isVisible ( ) const

\qmlproperty bool Qt.labs.platform::Menu::visible

This property holds whether the menu is visible. The default value is true.

Definition at line 397 of file qquicklabsplatformmenu.cpp.

◆ items()

QQmlListProperty< QQuickLabsPlatformMenuItem > QQuickLabsPlatformMenu::items ( )

◆ items_append()

void QQuickLabsPlatformMenu::items_append ( QQmlListProperty< QQuickLabsPlatformMenuItem > * property,
QQuickLabsPlatformMenuItem * item )
staticprotected

Definition at line 799 of file qquicklabsplatformmenu.cpp.

References item, and menu.

◆ items_at()

QQuickLabsPlatformMenuItem * QQuickLabsPlatformMenu::items_at ( QQmlListProperty< QQuickLabsPlatformMenuItem > * property,
qsizetype index )
staticprotected

Definition at line 811 of file qquicklabsplatformmenu.cpp.

References menu.

◆ items_clear()

void QQuickLabsPlatformMenu::items_clear ( QQmlListProperty< QQuickLabsPlatformMenuItem > * property)
staticprotected

Definition at line 817 of file qquicklabsplatformmenu.cpp.

References QMenu::clear(), and menu.

+ Here is the call graph for this function:

◆ items_count()

qsizetype QQuickLabsPlatformMenu::items_count ( QQmlListProperty< QQuickLabsPlatformMenuItem > * property)
staticprotected

Definition at line 805 of file qquicklabsplatformmenu.cpp.

References menu, and QWidget::size.

◆ itemsChanged

void QQuickLabsPlatformMenu::itemsChanged ( )
signal

Referenced by clear(), insertItem(), and removeItem().

+ Here is the caller graph for this function:

◆ menuBar()

QQuickLabsPlatformMenuBar * QQuickLabsPlatformMenu::menuBar ( ) const

\readonly \qmlproperty MenuBar Qt.labs.platform::Menu::menuBar

This property holds the menubar that the menu belongs to, or null if the menu is not in a menubar.

Definition at line 287 of file qquicklabsplatformmenu.cpp.

◆ menuBarChanged

void QQuickLabsPlatformMenu::menuBarChanged ( )
signal

Referenced by setMenuBar().

+ Here is the caller graph for this function:

◆ menuItem()

QQuickLabsPlatformMenuItem * QQuickLabsPlatformMenu::menuItem ( ) const

\readonly \qmlproperty MenuItem Qt.labs.platform::Menu::menuItem

This property holds the item that presents the menu (in a parent menu).

Definition at line 354 of file qquicklabsplatformmenu.cpp.

References QQuickLabsPlatformMenuItem::componentComplete(), icon, QQuickLabsPlatformMenuItem::setEnabled(), QQuickLabsPlatformMenuItem::setIcon(), QQuickLabsPlatformMenuItem::setSubMenu(), QQuickLabsPlatformMenuItem::setText(), and QQuickLabsPlatformMenuItem::setVisible().

+ Here is the call graph for this function:

◆ minimumWidth()

int QQuickLabsPlatformMenu::minimumWidth ( ) const

\qmlproperty int Qt.labs.platform::Menu::minimumWidth

This property holds the minimum width of the menu. The default value is -1 (no minimum width).

Definition at line 420 of file qquicklabsplatformmenu.cpp.

◆ minimumWidthChanged

void QQuickLabsPlatformMenu::minimumWidthChanged ( )
signal

Referenced by setMinimumWidth().

+ Here is the caller graph for this function:

◆ open

void QQuickLabsPlatformMenu::open ( QQmlV4FunctionPtr args)
slot

\qmlmethod void Qt.labs.platform::Menu::open(MenuItem item)

Opens the menu at the current mouse position, optionally aligned to a menu item.

\qmlmethod void Qt.labs.platform::Menu::open(Item target, MenuItem item)

Opens the menu at the specified target item, optionally aligned to a menu item.

Definition at line 653 of file qquicklabsplatformmenu.cpp.

References args, QQuickItem::boundingRect(), findWindow(), QQuickLabsPlatformMenuItem::handle(), QList< T >::length(), QQuickItem::mapRectToScene(), menuItem, pos, QCursor::pos(), qobject_cast< QQuickItem * >(), QPlatformMenu::showPopup(), QRectF::toAlignedRect(), QHighDpi::toNativePixels(), QRect::translated(), and window().

+ Here is the call graph for this function:

◆ parentMenu()

QQuickLabsPlatformMenu * QQuickLabsPlatformMenu::parentMenu ( ) const

\readonly \qmlproperty Menu Qt.labs.platform::Menu::parentMenu

This property holds the parent menu that the menu belongs to, or null if the menu is not a sub-menu.

Definition at line 309 of file qquicklabsplatformmenu.cpp.

◆ parentMenuChanged

void QQuickLabsPlatformMenu::parentMenuChanged ( )
signal

Referenced by setParentMenu().

+ Here is the caller graph for this function:

◆ Q_REVISION

QQuickLabsPlatformMenu::Q_REVISION ( 2 ,
1  )
signal

◆ removeItem()

void QQuickLabsPlatformMenu::removeItem ( QQuickLabsPlatformMenuItem * item)

\qmlmethod void Qt.labs.platform::Menu::removeItem(MenuItem item)

Removes an item from the menu.

Definition at line 568 of file qquicklabsplatformmenu.cpp.

References emit, item, itemsChanged(), QPlatformMenu::removeMenuItem(), QList< T >::removeOne(), and sync().

Referenced by QQuickLabsPlatformMenuItem::~QQuickLabsPlatformMenuItem(), and removeMenu().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeMenu()

void QQuickLabsPlatformMenu::removeMenu ( QQuickLabsPlatformMenu * menu)

\qmlmethod void Qt.labs.platform::Menu::removeMenu(Menu submenu)

Removes a submenu from the menu.

Definition at line 610 of file qquicklabsplatformmenu.cpp.

References menu, and removeItem().

Referenced by ~QQuickLabsPlatformMenu().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setEnabled()

void QQuickLabsPlatformMenu::setEnabled ( bool enabled)

Definition at line 379 of file qquicklabsplatformmenu.cpp.

References emit, enabled, enabledChanged(), QQuickLabsPlatformMenuItem::setEnabled(), and sync().

+ Here is the call graph for this function:

◆ setFont()

void QQuickLabsPlatformMenu::setFont ( const QFont & font)

Definition at line 494 of file qquicklabsplatformmenu.cpp.

References emit, font, fontChanged(), and sync().

+ Here is the call graph for this function:

◆ setIcon()

void QQuickLabsPlatformMenu::setIcon ( const QQuickLabsPlatformIcon & icon)

Definition at line 520 of file qquicklabsplatformmenu.cpp.

References emit, icon, iconLoader(), QQuickLabsPlatformIconLoader::setIcon(), and QQuickLabsPlatformMenuItem::setIcon().

+ Here is the call graph for this function:

◆ setMenuBar()

void QQuickLabsPlatformMenu::setMenuBar ( QQuickLabsPlatformMenuBar * menuBar)

Definition at line 292 of file qquicklabsplatformmenu.cpp.

References destroy(), emit, menuBar, and menuBarChanged().

+ Here is the call graph for this function:

◆ setMinimumWidth()

void QQuickLabsPlatformMenu::setMinimumWidth ( int width)

Definition at line 425 of file qquicklabsplatformmenu.cpp.

References emit, minimumWidthChanged(), and sync().

+ Here is the call graph for this function:

◆ setParentMenu()

void QQuickLabsPlatformMenu::setParentMenu ( QQuickLabsPlatformMenu * menu)

Definition at line 314 of file qquicklabsplatformmenu.cpp.

References destroy(), emit, menu, and parentMenuChanged().

+ Here is the call graph for this function:

◆ setTitle()

void QQuickLabsPlatformMenu::setTitle ( const QString & title)

Definition at line 469 of file qquicklabsplatformmenu.cpp.

References emit, QQuickLabsPlatformMenuItem::setText(), sync(), title, and titleChanged().

+ Here is the call graph for this function:

◆ setType()

void QQuickLabsPlatformMenu::setType ( QPlatformMenu::MenuType type)

Definition at line 449 of file qquicklabsplatformmenu.cpp.

References emit, sync(), type, and typeChanged().

+ Here is the call graph for this function:

◆ setVisible()

void QQuickLabsPlatformMenu::setVisible ( bool visible)

Definition at line 402 of file qquicklabsplatformmenu.cpp.

References emit, QQuickLabsPlatformMenuItem::setVisible(), sync(), visible, and visibleChanged().

+ Here is the call graph for this function:

◆ sync()

void QQuickLabsPlatformMenu::sync ( )

Definition at line 232 of file qquicklabsplatformmenu.cpp.

References create(), QQuickLabsPlatformMenuBar::handle(), QQuickLabsPlatformSystemTrayIcon::handle(), item, QPlatformMenu::setEnabled(), QPlatformMenu::setFont(), QPlatformMenu::setMenuType(), QPlatformMenu::setMinimumWidth(), QPlatformMenu::setText(), QPlatformMenu::setVisible(), QPlatformMenuBar::syncMenu(), and QPlatformSystemTrayIcon::updateMenu().

Referenced by clear(), componentComplete(), insertItem(), removeItem(), setEnabled(), setFont(), setMinimumWidth(), setTitle(), setType(), setVisible(), and QQuickLabsPlatformMenuItem::sync().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ systemTrayIconChanged

void QQuickLabsPlatformMenu::systemTrayIconChanged ( )
signal

◆ title()

QString QQuickLabsPlatformMenu::title ( ) const

\qmlproperty string Qt.labs.platform::Menu::title

This property holds the menu's title.

Definition at line 464 of file qquicklabsplatformmenu.cpp.

◆ titleChanged

void QQuickLabsPlatformMenu::titleChanged ( )
signal

Referenced by setTitle().

+ Here is the caller graph for this function:

◆ type()

QPlatformMenu::MenuType QQuickLabsPlatformMenu::type ( ) const

\qmlproperty enumeration Qt.labs.platform::Menu::type

This property holds the type of the menu.

Available values: \value Menu.DefaultMenu A normal menu (default). \value Menu.EditMenu An edit menu with pre-populated cut, copy and paste items.

Definition at line 444 of file qquicklabsplatformmenu.cpp.

◆ typeChanged

void QQuickLabsPlatformMenu::typeChanged ( )
signal

Referenced by setType().

+ Here is the caller graph for this function:

◆ visibleChanged

void QQuickLabsPlatformMenu::visibleChanged ( )
signal

Referenced by setVisible().

+ Here is the caller graph for this function:

Property Documentation

◆ data

QQmlListProperty< QObject > QQuickLabsPlatformMenu::data
read

\qmldefault \qmlproperty list<QtObject> Qt.labs.platform::Menu::data

This default property holds the list of all objects declared as children of the menu. The data property includes objects that are not \l MenuItem instances, such as \l Timer and \l QtObject.

See also
items

Definition at line 45 of file qquicklabsplatformmenu_p.h.

◆ enabled

bool QQuickLabsPlatformMenu::enabled
readwrite

Definition at line 53 of file qquicklabsplatformmenu_p.h.

Referenced by setEnabled().

◆ font

QFont QQuickLabsPlatformMenu::font
readwrite

Definition at line 58 of file qquicklabsplatformmenu_p.h.

Referenced by setFont().

◆ icon

QQuickLabsPlatformIcon QQuickLabsPlatformMenu::icon
readwrite

Definition at line 59 of file qquicklabsplatformmenu_p.h.

Referenced by menuItem(), and setIcon().

◆ items

QQmlListProperty< QQuickLabsPlatformMenuItem > QQuickLabsPlatformMenu::items
read

\qmlproperty list<MenuItem> Qt.labs.platform::Menu::items

This property holds the list of items in the menu.

Definition at line 46 of file qquicklabsplatformmenu_p.h.

◆ menuBar

QQuickLabsPlatformMenuBar * QQuickLabsPlatformMenu::menuBar
read

Definition at line 47 of file qquicklabsplatformmenu_p.h.

Referenced by setMenuBar().

◆ menuItem

QQuickLabsPlatformMenuItem * QQuickLabsPlatformMenu::menuItem
read

Definition at line 52 of file qquicklabsplatformmenu_p.h.

Referenced by open().

◆ minimumWidth

int QQuickLabsPlatformMenu::minimumWidth
readwrite

Definition at line 55 of file qquicklabsplatformmenu_p.h.

◆ parentMenu

QQuickLabsPlatformMenu * QQuickLabsPlatformMenu::parentMenu
read

Definition at line 48 of file qquicklabsplatformmenu_p.h.

◆ title

QString QQuickLabsPlatformMenu::title
readwrite

Definition at line 57 of file qquicklabsplatformmenu_p.h.

Referenced by setTitle().

◆ type

QPlatformMenu::MenuType QQuickLabsPlatformMenu::type
readwrite

Definition at line 56 of file qquicklabsplatformmenu_p.h.

Referenced by setType().

◆ visible

bool QQuickLabsPlatformMenu::visible
readwrite

Definition at line 54 of file qquicklabsplatformmenu_p.h.

Referenced by setVisible().


The documentation for this class was generated from the following files: