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
QQuickLabsPlatformMenuItem Class Reference

#include <qquicklabsplatformmenuitem_p.h>

+ Inheritance diagram for QQuickLabsPlatformMenuItem:
+ Collaboration diagram for QQuickLabsPlatformMenuItem:

Public Slots

void toggle ()
 \qmlmethod void Qt.labs.platform::MenuItem::toggle()
 
- Public Slots inherited from QObject
void deleteLater ()
 \threadsafe
 

Signals

void triggered ()
 
void hovered ()
 
void menuChanged ()
 
void subMenuChanged ()
 
void groupChanged ()
 
void enabledChanged ()
 
void visibleChanged ()
 
void separatorChanged ()
 
void checkableChanged ()
 
void checkedChanged ()
 
void roleChanged ()
 
void textChanged ()
 
void shortcutChanged ()
 
void fontChanged ()
 
 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

 QQuickLabsPlatformMenuItem (QObject *parent=nullptr)
 A native menu item.
 
 ~QQuickLabsPlatformMenuItem ()
 
QPlatformMenuItemhandle () const
 
QPlatformMenuItemcreate ()
 
void sync ()
 
QQuickLabsPlatformMenumenu () const
 \readonly \qmlproperty Menu Qt.labs.platform::MenuItem::menu
 
void setMenu (QQuickLabsPlatformMenu *menu)
 
QQuickLabsPlatformMenusubMenu () const
 \readonly \qmlproperty Menu Qt.labs.platform::MenuItem::subMenu
 
void setSubMenu (QQuickLabsPlatformMenu *menu)
 
QQuickLabsPlatformMenuItemGroupgroup () const
 \qmlproperty MenuItemGroup Qt.labs.platform::MenuItem::group
 
void setGroup (QQuickLabsPlatformMenuItemGroup *group)
 
bool isEnabled () const
 \qmlproperty bool Qt.labs.platform::MenuItem::enabled
 
void setEnabled (bool enabled)
 
bool isVisible () const
 \qmlproperty bool Qt.labs.platform::MenuItem::visible
 
void setVisible (bool visible)
 
bool isSeparator () const
 \qmlproperty bool Qt.labs.platform::MenuItem::separator
 
void setSeparator (bool separator)
 
bool isCheckable () const
 \qmlproperty bool Qt.labs.platform::MenuItem::checkable
 
void setCheckable (bool checkable)
 
bool isChecked () const
 \qmlproperty bool Qt.labs.platform::MenuItem::checked
 
void setChecked (bool checked)
 
QPlatformMenuItem::MenuRole role () const
 \qmlproperty enumeration Qt.labs.platform::MenuItem::role
 
void setRole (QPlatformMenuItem::MenuRole role)
 
QString text () const
 \qmlproperty string Qt.labs.platform::MenuItem::text
 
void setText (const QString &text)
 
QVariant shortcut () const
 \qmlproperty keysequence Qt.labs.platform::MenuItem::shortcut
 
void setShortcut (const QVariant &shortcut)
 
QFont font () const
 \qmlproperty font Qt.labs.platform::MenuItem::font
 
void setFont (const QFont &font)
 
QQuickLabsPlatformIcon icon () const
 
void setIcon (const QQuickLabsPlatformIcon &icon)
 
- 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 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
 
bool event (QEvent *e) override
 This virtual function receives events to an object and should return true if the event e was recognized and processed.
 
- 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)
 

Properties

QQuickLabsPlatformMenumenu
 
QQuickLabsPlatformMenusubMenu
 
QQuickLabsPlatformMenuItemGroupgroup
 
bool enabled
 
bool visible
 
bool separator
 
bool checkable
 
bool checked
 
QPlatformMenuItem::MenuRole role
 
QString text
 
QVariant shortcut
 
QFont font
 
QQuickLabsPlatformIcon icon
 
- Properties inherited from QObject
QString objectName
 the name of this object
 

Friends

class QQuickLabsPlatformMenu
 
class QQuickLabsPlatformMenuItemGroup
 

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 34 of file qquicklabsplatformmenuitem_p.h.

Constructor & Destructor Documentation

◆ QQuickLabsPlatformMenuItem()

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

A native menu item.

\qmltype MenuItem
\inherits QtObject

! \instantiates QQuickLabsPlatformMenuItem \inqmlmodule Qt.labs.platform

Since
5.8

The MenuItem type provides a QML API for native platform menu items.

A menu item consists of an \l icon, \l text, and \l shortcut.

Menu {
id: zoomMenu
MenuItem {
text: qsTr("Zoom In")
shortcut: StandardKey.ZoomIn
onTriggered: zoomIn()
}
MenuItem {
text: qsTr("Zoom Out")
shortcut: StandardKey.ZoomOut
onTriggered: zoomOut()
}
}
GLenum GLuint id
[7]

\labs

See also
Menu, MenuItemGroup

\qmlsignal Qt.labs.platform::MenuItem::triggered()

This signal is emitted when the menu item is triggered by the user.

\qmlsignal Qt.labs.platform::MenuItem::hovered()

This signal is emitted when the menu item is hovered by the user.

Definition at line 70 of file qquicklabsplatformmenuitem.cpp.

◆ ~QQuickLabsPlatformMenuItem()

QQuickLabsPlatformMenuItem::~QQuickLabsPlatformMenuItem ( )

Definition at line 87 of file qquicklabsplatformmenuitem.cpp.

References QQuickLabsPlatformMenu::removeItem(), and QQuickLabsPlatformMenuItemGroup::removeItem().

+ Here is the call graph for this function:

Member Function Documentation

◆ checkableChanged

void QQuickLabsPlatformMenuItem::checkableChanged ( )
signal

Referenced by setCheckable().

+ Here is the caller graph for this function:

◆ checkedChanged

void QQuickLabsPlatformMenuItem::checkedChanged ( )
signal

Referenced by QQuickLabsPlatformMenuItemGroup::addItem(), QQuickLabsPlatformMenuItemGroup::clear(), QQuickLabsPlatformMenuItemGroup::removeItem(), and setChecked().

+ Here is the caller graph for this function:

◆ classBegin()

void QQuickLabsPlatformMenuItem::classBegin ( )
overrideprotectedvirtual

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

Implements QQmlParserStatus.

Definition at line 551 of file qquicklabsplatformmenuitem.cpp.

◆ componentComplete()

void QQuickLabsPlatformMenuItem::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 555 of file qquicklabsplatformmenuitem.cpp.

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

Referenced by QQuickLabsPlatformMenu::menuItem().

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

◆ create()

QPlatformMenuItem * QQuickLabsPlatformMenuItem::create ( )

Definition at line 105 of file qquicklabsplatformmenuitem.cpp.

References QPlatformMenuItem::activated(), QObject::connect(), QPlatformMenu::createMenuItem(), QWidgetPlatform::createMenuItem(), QQuickLabsPlatformMenu::handle(), QPlatformMenuItem::hovered(), hovered(), and QGuiApplicationPrivate::platformTheme().

Referenced by QQuickLabsPlatformMenu::create(), QQuickLabsPlatformMenu::insertItem(), and sync().

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

◆ enabledChanged

void QQuickLabsPlatformMenuItem::enabledChanged ( )
signal

Referenced by setEnabled(), and setGroup().

+ Here is the caller graph for this function:

◆ event()

bool QQuickLabsPlatformMenuItem::event ( QEvent * e)
overrideprotectedvirtual

This virtual function receives events to an object and should return true if the event e was recognized and processed.

The event() function can be reimplemented to customize the behavior of an object.

Make sure you call the parent event class implementation for all the events you did not handle.

Example:

class MyClass : public QWidget
{
public:
MyClass(QWidget *parent = nullptr);
bool event(QEvent* ev) override
{
if (ev->type() == QEvent::PolishRequest) {
// overwrite handling of PolishRequest if any
doThings();
return true;
} else if (ev->type() == QEvent::Show) {
// complement handling of Show if any
doThings2();
return true;
}
// Make sure the rest of events are handled
return QWidget::event(ev);
}
};
See also
installEventFilter(), timerEvent(), QCoreApplication::sendEvent(), QCoreApplication::postEvent()

Reimplemented from QObject.

Definition at line 457 of file qquicklabsplatformmenuitem.cpp.

References QObject::event(), QEvent::Shortcut, and QEvent::type().

+ Here is the call graph for this function:

◆ font()

QFont QQuickLabsPlatformMenuItem::font ( ) const

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

This property holds the menu item's font.

See also
text

Definition at line 490 of file qquicklabsplatformmenuitem.cpp.

◆ fontChanged

void QQuickLabsPlatformMenuItem::fontChanged ( )
signal

Referenced by setFont().

+ Here is the caller graph for this function:

◆ group()

QQuickLabsPlatformMenuItemGroup * QQuickLabsPlatformMenuItem::group ( ) const

\qmlproperty MenuItemGroup Qt.labs.platform::MenuItem::group

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

Definition at line 215 of file qquicklabsplatformmenuitem.cpp.

◆ groupChanged

void QQuickLabsPlatformMenuItem::groupChanged ( )
signal

Referenced by setGroup().

+ Here is the caller graph for this function:

◆ handle()

QPlatformMenuItem * QQuickLabsPlatformMenuItem::handle ( ) const

Definition at line 100 of file qquicklabsplatformmenuitem.cpp.

Referenced by QQuickLabsPlatformMenu::open().

+ Here is the caller graph for this function:

◆ hovered

void QQuickLabsPlatformMenuItem::hovered ( )
signal

Referenced by QQuickLabsPlatformMenuItemGroup::addItem(), QQuickLabsPlatformMenuItemGroup::clear(), create(), and QQuickLabsPlatformMenuItemGroup::removeItem().

+ Here is the caller graph for this function:

◆ icon()

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

This property holds the menu item's icon.

MenuItem {
icon.mask: true
icon.name: "edit-undo"
icon.source: "qrc:/images/undo.png"
}
See also
QIcon::fromTheme()

Definition at line 523 of file qquicklabsplatformmenuitem.cpp.

References QQuickLabsPlatformIconLoader::icon().

+ Here is the call graph for this function:

◆ iconLoader()

QQuickLabsPlatformIconLoader * QQuickLabsPlatformMenuItem::iconLoader ( ) const
protected

Definition at line 563 of file qquicklabsplatformmenuitem.cpp.

References QQuickLabsPlatformIconLoader::setEnabled().

Referenced by setIcon().

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

◆ isCheckable()

bool QQuickLabsPlatformMenuItem::isCheckable ( ) const

\qmlproperty bool Qt.labs.platform::MenuItem::checkable

This property holds whether the item is checkable.

A checkable menu item has an on/off state. For example, in a word processor, a "Bold" menu item may be either on or off. A menu item that is not checkable is a command item that is simply executed, e.g. file save.

The default value is false.

See also
checked, MenuItemGroup

Definition at line 334 of file qquicklabsplatformmenuitem.cpp.

◆ isChecked()

bool QQuickLabsPlatformMenuItem::isChecked ( ) const

\qmlproperty bool Qt.labs.platform::MenuItem::checked

This property holds whether the item is checked (on) or unchecked (off). The default value is false.

See also
checkable, MenuItemGroup

Definition at line 357 of file qquicklabsplatformmenuitem.cpp.

◆ isEnabled()

bool QQuickLabsPlatformMenuItem::isEnabled ( ) const

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

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

Disabled items cannot be triggered by the user. They do not disappear from menus, but they are displayed in a way which indicates that they are unavailable. For example, they might be displayed using only shades of gray.

When an item is disabled, it is not possible to trigger it through its \l shortcut.

Definition at line 252 of file qquicklabsplatformmenuitem.cpp.

References QQuickLabsPlatformMenuItemGroup::isEnabled().

Referenced by setEnabled(), setGroup(), and sync().

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

◆ isSeparator()

bool QQuickLabsPlatformMenuItem::isSeparator ( ) const

\qmlproperty bool Qt.labs.platform::MenuItem::separator

This property holds whether the item is a separator line. The default value is false.

See also
MenuSeparator

Definition at line 306 of file qquicklabsplatformmenuitem.cpp.

◆ isVisible()

bool QQuickLabsPlatformMenuItem::isVisible ( ) const

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

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

Definition at line 281 of file qquicklabsplatformmenuitem.cpp.

References QQuickLabsPlatformMenuItemGroup::isVisible().

Referenced by setGroup(), setVisible(), and sync().

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

◆ menu()

QQuickLabsPlatformMenu * QQuickLabsPlatformMenuItem::menu ( ) const

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

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

Definition at line 173 of file qquicklabsplatformmenuitem.cpp.

◆ menuChanged

void QQuickLabsPlatformMenuItem::menuChanged ( )
signal

Referenced by setMenu().

+ Here is the caller graph for this function:

◆ Q_REVISION

QQuickLabsPlatformMenuItem::Q_REVISION ( 2 ,
1  )
signal

◆ role()

QPlatformMenuItem::MenuRole QQuickLabsPlatformMenuItem::role ( ) const

\qmlproperty enumeration Qt.labs.platform::MenuItem::role

This property holds the role of the item. The role determines whether the item should be placed into the application menu on macOS.

Available values: \value MenuItem.NoRole The item should not be put into the application menu \value MenuItem.TextHeuristicRole The item should be put in the application menu based on the action's text (default) \value MenuItem.ApplicationSpecificRole The item should be put in the application menu with an application-specific role \value MenuItem.AboutQtRole The item handles the "About Qt" menu item. \value MenuItem.AboutRole The item should be placed where the "About" menu item is in the application menu. The text of the menu item will be set to "About <application name>". The application name is fetched from the {Info.plist} file in the application's bundle (See \l{Qt for macOS - Deployment}). \value MenuItem.PreferencesRole The item should be placed where the "Preferences..." menu item is in the application menu. \value MenuItem.QuitRole The item should be placed where the Quit menu item is in the application menu.

Specifying the role only has effect on items that are in the immediate menus of a menubar, not in the submenus of those menus. For example, if you have a "File" menu in your menubar and the "File" menu has a submenu, specifying a role for the items in that submenu has no effect. They will never be moved to the application menu.

Definition at line 398 of file qquicklabsplatformmenuitem.cpp.

◆ roleChanged

void QQuickLabsPlatformMenuItem::roleChanged ( )
signal

Referenced by setRole().

+ Here is the caller graph for this function:

◆ separatorChanged

void QQuickLabsPlatformMenuItem::separatorChanged ( )
signal

Referenced by setSeparator().

+ Here is the caller graph for this function:

◆ setCheckable()

void QQuickLabsPlatformMenuItem::setCheckable ( bool checkable)

Definition at line 339 of file qquicklabsplatformmenuitem.cpp.

References checkable, checkableChanged(), emit, and sync().

Referenced by setChecked().

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

◆ setChecked()

void QQuickLabsPlatformMenuItem::setChecked ( bool checked)

Definition at line 362 of file qquicklabsplatformmenuitem.cpp.

References checked, checkedChanged(), emit, setCheckable(), and sync().

Referenced by QQuickLabsPlatformMenuItemGroup::setCheckedItem(), and toggle().

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

◆ setEnabled()

void QQuickLabsPlatformMenuItem::setEnabled ( bool enabled)

Definition at line 257 of file qquicklabsplatformmenuitem.cpp.

References emit, enabled, enabledChanged(), isEnabled(), and sync().

Referenced by QQuickLabsPlatformMenu::menuItem(), and QQuickLabsPlatformMenu::setEnabled().

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

◆ setFont()

void QQuickLabsPlatformMenuItem::setFont ( const QFont & font)

Definition at line 495 of file qquicklabsplatformmenuitem.cpp.

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

+ Here is the call graph for this function:

◆ setGroup()

void QQuickLabsPlatformMenuItem::setGroup ( QQuickLabsPlatformMenuItemGroup * group)

Definition at line 220 of file qquicklabsplatformmenuitem.cpp.

References emit, enabledChanged(), group, groupChanged(), isEnabled(), isVisible(), sync(), and visibleChanged().

+ Here is the call graph for this function:

◆ setIcon()

void QQuickLabsPlatformMenuItem::setIcon ( const QQuickLabsPlatformIcon & icon)

Definition at line 531 of file qquicklabsplatformmenuitem.cpp.

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

Referenced by QQuickLabsPlatformMenu::menuItem(), and QQuickLabsPlatformMenu::setIcon().

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

◆ setMenu()

void QQuickLabsPlatformMenuItem::setMenu ( QQuickLabsPlatformMenu * menu)

Definition at line 178 of file qquicklabsplatformmenuitem.cpp.

References emit, menu, and menuChanged().

+ Here is the call graph for this function:

◆ setRole()

void QQuickLabsPlatformMenuItem::setRole ( QPlatformMenuItem::MenuRole role)

Definition at line 403 of file qquicklabsplatformmenuitem.cpp.

References emit, role, roleChanged(), and sync().

+ Here is the call graph for this function:

◆ setSeparator()

void QQuickLabsPlatformMenuItem::setSeparator ( bool separator)

Definition at line 311 of file qquicklabsplatformmenuitem.cpp.

References emit, separator, separatorChanged(), and sync().

Referenced by QQuickLabsPlatformMenuSeparator::QQuickLabsPlatformMenuSeparator().

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

◆ setShortcut()

void QQuickLabsPlatformMenuItem::setShortcut ( const QVariant & shortcut)

Definition at line 471 of file qquicklabsplatformmenuitem.cpp.

References emit, shortcut, shortcutChanged(), and sync().

+ Here is the call graph for this function:

◆ setSubMenu()

void QQuickLabsPlatformMenuItem::setSubMenu ( QQuickLabsPlatformMenu * menu)

Definition at line 199 of file qquicklabsplatformmenuitem.cpp.

References emit, menu, subMenuChanged(), and sync().

Referenced by QQuickLabsPlatformMenu::menuItem().

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

◆ setText()

void QQuickLabsPlatformMenuItem::setText ( const QString & text)

Definition at line 423 of file qquicklabsplatformmenuitem.cpp.

References emit, sync(), text, and textChanged().

Referenced by QQuickLabsPlatformMenu::menuItem(), and QQuickLabsPlatformMenu::setTitle().

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

◆ setVisible()

void QQuickLabsPlatformMenuItem::setVisible ( bool visible)

Definition at line 286 of file qquicklabsplatformmenuitem.cpp.

References emit, isVisible(), sync(), visible, and visibleChanged().

Referenced by QQuickLabsPlatformMenu::menuItem(), and QQuickLabsPlatformMenu::setVisible().

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

◆ shortcut()

QVariant QQuickLabsPlatformMenuItem::shortcut ( ) const

\qmlproperty keysequence Qt.labs.platform::MenuItem::shortcut

This property holds the menu item's shortcut.

The shortcut key sequence can be set to one of the \l{QKeySequence::StandardKey}{standard keyboard shortcuts}, or it can be specified by a string containing a sequence of up to four key presses that are needed to \l{triggered}{trigger} the shortcut.

The default value is an empty key sequence.

MenuItem {
shortcut: "Ctrl+E,Ctrl+W"
onTriggered: edit.wrapMode = TextEdit.Wrap
}

Definition at line 452 of file qquicklabsplatformmenuitem.cpp.

◆ shortcutChanged

void QQuickLabsPlatformMenuItem::shortcutChanged ( )
signal

Referenced by setShortcut().

+ Here is the caller graph for this function:

◆ subMenu()

QQuickLabsPlatformMenu * QQuickLabsPlatformMenuItem::subMenu ( ) const

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

This property holds the sub-menu that the item contains, or null if the item is not a sub-menu item.

Definition at line 194 of file qquicklabsplatformmenuitem.cpp.

◆ subMenuChanged

void QQuickLabsPlatformMenuItem::subMenuChanged ( )
signal

Referenced by setSubMenu().

+ Here is the caller graph for this function:

◆ sync()

◆ text()

QString QQuickLabsPlatformMenuItem::text ( ) const

\qmlproperty string Qt.labs.platform::MenuItem::text

This property holds the menu item's text.

Definition at line 418 of file qquicklabsplatformmenuitem.cpp.

◆ textChanged

void QQuickLabsPlatformMenuItem::textChanged ( )
signal

Referenced by setText().

+ Here is the caller graph for this function:

◆ toggle

void QQuickLabsPlatformMenuItem::toggle ( )
slot

\qmlmethod void Qt.labs.platform::MenuItem::toggle()

Toggles the \l checked state to its opposite state.

Definition at line 545 of file qquicklabsplatformmenuitem.cpp.

References setChecked().

+ Here is the call graph for this function:

◆ triggered

void QQuickLabsPlatformMenuItem::triggered ( )
signal

Referenced by QQuickLabsPlatformMenuItemGroup::addItem(), QQuickLabsPlatformMenuItemGroup::clear(), and QQuickLabsPlatformMenuItemGroup::removeItem().

+ Here is the caller graph for this function:

◆ visibleChanged

void QQuickLabsPlatformMenuItem::visibleChanged ( )
signal

Referenced by setGroup(), and setVisible().

+ Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ QQuickLabsPlatformMenu

friend class QQuickLabsPlatformMenu
friend

Definition at line 154 of file qquicklabsplatformmenuitem_p.h.

◆ QQuickLabsPlatformMenuItemGroup

friend class QQuickLabsPlatformMenuItemGroup
friend

Definition at line 155 of file qquicklabsplatformmenuitem_p.h.

Property Documentation

◆ checkable

bool QQuickLabsPlatformMenuItem::checkable
readwrite

Definition at line 46 of file qquicklabsplatformmenuitem_p.h.

Referenced by setCheckable().

◆ checked

bool QQuickLabsPlatformMenuItem::checked
readwrite

Definition at line 47 of file qquicklabsplatformmenuitem_p.h.

Referenced by setChecked().

◆ enabled

bool QQuickLabsPlatformMenuItem::enabled
readwrite

Definition at line 43 of file qquicklabsplatformmenuitem_p.h.

Referenced by setEnabled().

◆ font

QFont QQuickLabsPlatformMenuItem::font
readwrite

Definition at line 51 of file qquicklabsplatformmenuitem_p.h.

Referenced by setFont().

◆ group

QQuickLabsPlatformMenuItemGroup * QQuickLabsPlatformMenuItem::group
readwrite

Definition at line 42 of file qquicklabsplatformmenuitem_p.h.

Referenced by setGroup().

◆ icon

QQuickLabsPlatformIcon QQuickLabsPlatformMenuItem::icon
readwrite

Definition at line 52 of file qquicklabsplatformmenuitem_p.h.

Referenced by setIcon().

◆ menu

QQuickLabsPlatformMenu * QQuickLabsPlatformMenuItem::menu
read

Definition at line 40 of file qquicklabsplatformmenuitem_p.h.

Referenced by setMenu(), and setSubMenu().

◆ role

QPlatformMenuItem::MenuRole QQuickLabsPlatformMenuItem::role
readwrite

Definition at line 48 of file qquicklabsplatformmenuitem_p.h.

Referenced by setRole().

◆ separator

bool QQuickLabsPlatformMenuItem::separator
readwrite

Definition at line 45 of file qquicklabsplatformmenuitem_p.h.

Referenced by setSeparator().

◆ shortcut

QVariant QQuickLabsPlatformMenuItem::shortcut
readwrite

Definition at line 50 of file qquicklabsplatformmenuitem_p.h.

Referenced by setShortcut().

◆ subMenu

QQuickLabsPlatformMenu * QQuickLabsPlatformMenuItem::subMenu
read

Definition at line 41 of file qquicklabsplatformmenuitem_p.h.

◆ text

QString QQuickLabsPlatformMenuItem::text
readwrite

Definition at line 49 of file qquicklabsplatformmenuitem_p.h.

Referenced by setText().

◆ visible

bool QQuickLabsPlatformMenuItem::visible
readwrite

Definition at line 44 of file qquicklabsplatformmenuitem_p.h.

Referenced by setVisible().


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