Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QQuickMenu Class Reference

#include <qquickmenu_p.h>

Inheritance diagram for QQuickMenu:
Collaboration diagram for QQuickMenu:

Signals

void titleChanged (const QString &title)
 Q_REVISION (2, 3) void countChanged()
 Q_REVISION (2, 3) void cascadeChanged(bool cascade)
 Q_REVISION (2, 3) void overlapChanged()
 Q_REVISION (2, 3) void delegateChanged()
 Q_REVISION (2, 3) void currentIndexChanged()
 Q_REVISION (6, 5) void iconChanged(const QQuickIcon &icon)
Signals inherited from QQuickPopup
void opened ()
void closed ()
void aboutToShow ()
void aboutToHide ()
void xChanged ()
void yChanged ()
void zChanged ()
void widthChanged ()
void heightChanged ()
void implicitWidthChanged ()
void implicitHeightChanged ()
void contentWidthChanged ()
void contentHeightChanged ()
void availableWidthChanged ()
void availableHeightChanged ()
void marginsChanged ()
void topMarginChanged ()
void leftMarginChanged ()
void rightMarginChanged ()
void bottomMarginChanged ()
void paddingChanged ()
void topPaddingChanged ()
void leftPaddingChanged ()
void rightPaddingChanged ()
void bottomPaddingChanged ()
void fontChanged ()
void localeChanged ()
void parentChanged ()
void backgroundChanged ()
void contentItemChanged ()
void contentChildrenChanged ()
void clipChanged ()
void focusChanged ()
void activeFocusChanged ()
void modalChanged ()
void dimChanged ()
void visibleChanged ()
void opacityChanged ()
void scaleChanged ()
void closePolicyChanged ()
void enterChanged ()
void exitChanged ()
void windowChanged (QQuickWindow *window)
 Q_REVISION (2, 1) void spacingChanged()
 Q_REVISION (2, 3) void openedChanged()
 Q_REVISION (2, 3) void mirroredChanged()
 Q_REVISION (2, 3) void enabledChanged()
 Q_REVISION (2, 3) void paletteChanged()
 Q_REVISION (2, 3) void paletteCreated()
 Q_REVISION (2, 5) void horizontalPaddingChanged()
 Q_REVISION (2, 5) void verticalPaddingChanged()
 Q_REVISION (2, 5) void implicitContentWidthChanged()
 Q_REVISION (2, 5) void implicitContentHeightChanged()
 Q_REVISION (2, 5) void implicitBackgroundWidthChanged()
 Q_REVISION (2, 5) void implicitBackgroundHeightChanged()
 Q_REVISION (2, 5) void topInsetChanged()
 Q_REVISION (2, 5) void leftInsetChanged()
 Q_REVISION (2, 5) void rightInsetChanged()
 Q_REVISION (2, 5) void bottomInsetChanged()
 Q_REVISION (6, 8) void popupTypeChanged()
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

 QQuickMenu (QObject *parent=nullptr)
 ~QQuickMenu ()
Q_INVOKABLE QQuickItemitemAt (int index) const
 \qmlmethod Item QtQuick.Controls::Menu::itemAt(int index)
Q_INVOKABLE void addItem (QQuickItem *item)
 \qmlmethod void QtQuick.Controls::Menu::addItem(Item item)
Q_INVOKABLE void insertItem (int index, QQuickItem *item)
 \qmlmethod void QtQuick.Controls::Menu::insertItem(int index, Item item)
Q_INVOKABLE void moveItem (int from, int to)
 \qmlmethod void QtQuick.Controls::Menu::moveItem(int from, int to)
Q_INVOKABLE void removeItem (QQuickItem *item)
QVariant contentModel () const
 \qmlproperty model QtQuick.Controls::Menu::contentModel \readonly
QQmlListProperty< QObjectcontentData ()
QString title () const
 \qmlproperty string QtQuick.Controls::Menu::title
void setTitle (const QString &title)
QQuickIcon icon () const
 \qmlproperty string QtQuick.Controls::Menu::icon.name \qmlproperty url QtQuick.Controls::Menu::icon.source \qmlproperty int QtQuick.Controls::Menu::icon.width \qmlproperty int QtQuick.Controls::Menu::icon.height \qmlproperty color QtQuick.Controls::Menu::icon.color \qmlproperty bool QtQuick.Controls::Menu::icon.cache
void setIcon (const QQuickIcon &icon)
bool cascade () const
void setCascade (bool cascade)
void resetCascade ()
qreal overlap () const
void setOverlap (qreal overlap)
QQmlComponentdelegate () const
void setDelegate (QQmlComponent *delegate)
int currentIndex () const
void setCurrentIndex (int index)
int count () const
 Q_REVISION (2, 3) Q_INVOKABLE QQuickItem *takeItem(int index)
 Q_REVISION (2, 3) Q_INVOKABLE QQuickMenu *menuAt(int index) const
 Q_REVISION (2, 3) Q_INVOKABLE void addMenu(QQuickMenu *menu)
 Q_REVISION (2, 3) Q_INVOKABLE void insertMenu(int index
 Q_REVISION (2, 3) Q_INVOKABLE void removeMenu(QQuickMenu *menu)
 Q_REVISION (2, 3) Q_INVOKABLE QQuickMenu *takeMenu(int index)
 Q_REVISION (2, 3) Q_INVOKABLE QQuickAction *actionAt(int index) const
 Q_REVISION (2, 3) Q_INVOKABLE void addAction(QQuickAction *action)
 Q_REVISION (2, 3) Q_INVOKABLE void insertAction(int index
 Q_REVISION (2, 3) Q_INVOKABLE void removeAction(QQuickAction *action)
 Q_REVISION (2, 3) Q_INVOKABLE QQuickAction *takeAction(int index)
bool isVisible () const override
 \qmlproperty bool QtQuick.Controls::Popup::visible
void setVisible (bool visible) override
 Q_REVISION (2, 3) Q_INVOKABLE void popup(QQuickItem *parent
 Q_REVISION (2, 3) Q_INVOKABLE void popup(QQuickItem *parent
 Q_REVISION (2, 3) Q_INVOKABLE void popup(QQuickItem *parent
 Q_REVISION (2, 3) Q_INVOKABLE void popup(QQuickItem *parent
 Q_REVISION (2, 3) Q_INVOKABLE void popup(qreal x
 Q_REVISION (2, 3) Q_INVOKABLE void popup(const QPointF &position
 Q_REVISION (2, 3) Q_INVOKABLE void dismiss()
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 isQmlObjectType () const
 Returns whether the object has been created by the QML engine or ownership has been explicitly set via QJSEngine::setObjectOwnership().
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 ()

Public Attributes

QQuickMenumenu
QQuickActionaction
qreal x
qreal qreal y
qreal qreal QQuickItemmenuItem = nullptr)
const QPointFposition
const QPointF QQuickItemmenuItem = nullptr)
QQuickItemmenuItem = nullptr)
qreal y
qreal QQuickItemmenuItem = nullptr)

Protected Member Functions

void componentComplete () override
 Invoked after the root component that caused this instantiation has completed construction.
void contentItemChange (QQuickItem *newItem, QQuickItem *oldItem) override
void itemChange (QQuickItem::ItemChange change, const QQuickItem::ItemChangeData &data) override
void keyPressEvent (QKeyEvent *event) override
void timerEvent (QTimerEvent *event) override
 This event handler can be reimplemented in a subclass to receive timer events for the object.
QFont defaultFont () const override
Protected Member Functions inherited from QQuickPopup
 QQuickPopup (QQuickPopupPrivate &dd, QObject *parent)
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.
bool isComponentComplete () const
virtual bool childMouseEventFilter (QQuickItem *child, QEvent *event)
virtual void focusInEvent (QFocusEvent *event)
virtual void focusOutEvent (QFocusEvent *event)
virtual void keyReleaseEvent (QKeyEvent *event)
virtual void mousePressEvent (QMouseEvent *event)
virtual void mouseMoveEvent (QMouseEvent *event)
virtual void mouseReleaseEvent (QMouseEvent *event)
virtual void mouseDoubleClickEvent (QMouseEvent *event)
virtual void mouseUngrabEvent ()
virtual bool overlayEvent (QQuickItem *item, QEvent *event)
virtual void contentSizeChange (const QSizeF &newSize, const QSizeF &oldSize)
virtual void fontChange (const QFont &newFont, const QFont &oldFont)
virtual void geometryChange (const QRectF &newGeometry, const QRectF &oldGeometry)
virtual void localeChange (const QLocale &newLocale, const QLocale &oldLocale)
virtual void marginsChange (const QMarginsF &newMargins, const QMarginsF &oldMargins)
virtual void paddingChange (const QMarginsF &newPadding, const QMarginsF &oldPadding)
virtual void spacingChange (qreal newSpacing, qreal oldSpacing)
virtual void insetChange (const QMarginsF &newInset, const QMarginsF &oldInset)
QString accessibleName () const
void maybeSetAccessibleName (const QString &name)
QVariant accessibleProperty (const char *propertyName)
bool setAccessibleProperty (const char *propertyName, const QVariant &value)
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 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

QVariant contentModel
QQmlListProperty< QObjectcontentData
 \qmlproperty list<QtObject> QtQuick.Controls::Menu::contentData \qmldefault
QString title
int count
bool cascade
qreal overlap
QQmlComponentdelegate
int currentIndex
QQuickIcon icon
Properties inherited from QQuickPopup
qreal x
qreal y
qreal z
qreal width
qreal height
qreal implicitWidth
qreal implicitHeight
qreal contentWidth
qreal contentHeight
qreal availableWidth
qreal availableHeight
qreal margins
qreal topMargin
qreal leftMargin
qreal rightMargin
qreal bottomMargin
qreal padding
qreal topPadding
qreal leftPadding
qreal rightPadding
qreal bottomPadding
QLocale locale
QFont font
QQuickItemparent
QQuickItembackground
QQuickItemcontentItem
bool clip
bool focus
bool activeFocus
bool modal
bool dim
bool visible
qreal opacity
qreal scale
ClosePolicy closePolicy
TransformOrigin transformOrigin
QQuickTransitionenter
QQuickTransitionexit
qreal spacing
bool opened
bool mirrored
bool enabled
Properties inherited from QObject
QString objectName
 the name of this object

Additional Inherited Members

Public Slots inherited from QQuickPopup
void open ()
 \qmlmethod void QtQuick.Controls::Popup::open()
void close ()
 \qmlmethod void QtQuick.Controls::Popup::close()
Public Slots inherited from QObject
void deleteLater ()
 \threadsafe
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 35 of file qquickmenu_p.h.

Constructor & Destructor Documentation

◆ QQuickMenu()

QQuickMenu::QQuickMenu ( QObject * parent = nullptr)
explicit

Definition at line 1369 of file qquickmenu.cpp.

◆ ~QQuickMenu()

QQuickMenu::~QQuickMenu ( )

Definition at line 1378 of file qquickmenu.cpp.

Member Function Documentation

◆ addItem()

void QQuickMenu::addItem ( QQuickItem * item)

\qmlmethod void QtQuick.Controls::Menu::addItem(Item item)

Adds item to the end of the list of items. The menu does not take ownership of the newly added item.

See also
{Dynamically Generating Menu Items}

Definition at line 1424 of file qquickmenu.cpp.

◆ cascade()

bool QQuickMenu::cascade ( ) const
Since
QtQuick.Controls 2.3 (Qt 5.10) \qmlproperty bool QtQuick.Controls::Menu::cascade

This property holds whether the menu cascades its sub-menus.

The default value is platform-specific. Menus are cascading by default on desktop platforms that have a mouse cursor available. Non-cascading menus are shown one menu at a time, and centered over the parent menu.

Note
Changing the value of the property has no effect while the menu is open.

non-native-only-property

See also
overlap

Definition at line 1904 of file qquickmenu.cpp.

◆ componentComplete()

void QQuickMenu::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 2185 of file qquickmenu.cpp.

◆ contentData()

QQmlListProperty< QObject > QQuickMenu::contentData ( )

◆ contentItemChange()

void QQuickMenu::contentItemChange ( QQuickItem * newItem,
QQuickItem * oldItem )
overrideprotectedvirtual

Reimplemented from QQuickPopup.

Definition at line 2194 of file qquickmenu.cpp.

◆ contentModel()

QVariant QQuickMenu::contentModel ( ) const

\qmlproperty model QtQuick.Controls::Menu::contentModel \readonly

This property holds the model used to display menu items.

The content model is provided for visualization purposes. It can be assigned as a model to a content item that presents the contents of the menu.

Menu {
contentItem: ListView {
model: menu.contentModel
}
}
QQuickMenu * menu
QQuickItem * contentItem
GLenum GLuint id
QSqlQueryModel * model
[16]

The model allows menu items to be statically declared as children of the menu.

Definition at line 1796 of file qquickmenu.cpp.

◆ count()

int QQuickMenu::count ( ) const
Since
QtQuick.Controls 2.3 (Qt 5.10) \qmlproperty int QtQuick.Controls::Menu::count \readonly

This property holds the number of items.

Definition at line 2030 of file qquickmenu.cpp.

◆ currentIndex()

int QQuickMenu::currentIndex ( ) const
Since
QtQuick.Controls 2.3 (Qt 5.10) \qmlproperty int QtQuick.Controls::Menu::currentIndex

This property holds the index of the currently highlighted item.

Menu items can be highlighted by mouse hover or keyboard navigation.

non-native-only-property

See also
MenuItem::highlighted

Definition at line 2011 of file qquickmenu.cpp.

◆ defaultFont()

QFont QQuickMenu::defaultFont ( ) const
overrideprotectedvirtual

Reimplemented from QQuickPopup.

Definition at line 2316 of file qquickmenu.cpp.

◆ delegate()

QQmlComponent * QQuickMenu::delegate ( ) const
Since
QtQuick.Controls 2.3 (Qt 5.10) \qmlproperty Component QtQuick.Controls::Menu::delegate

This property holds the component that is used to create items to present actions.

Menu {
Action { text: "Cut" }
Action { text: "Copy" }
Action { text: "Paste" }
}
Note
delegates will only be visible when using a \l {Menu types} {non-native Menu}.

{no-ownership} {Menu}

See also
Action

Definition at line 1983 of file qquickmenu.cpp.

◆ icon()

QQuickIcon QQuickMenu::icon ( ) const

\qmlproperty string QtQuick.Controls::Menu::icon.name \qmlproperty url QtQuick.Controls::Menu::icon.source \qmlproperty int QtQuick.Controls::Menu::icon.width \qmlproperty int QtQuick.Controls::Menu::icon.height \qmlproperty color QtQuick.Controls::Menu::icon.color \qmlproperty bool QtQuick.Controls::Menu::icon.cache

This property group was added in QtQuick.Controls 6.5.

grouped-properties

non-native-only-property

See also
AbstractButton::text, AbstractButton::display, {Icons in Qt Quick Controls}

Definition at line 1872 of file qquickmenu.cpp.

◆ insertItem()

void QQuickMenu::insertItem ( int index,
QQuickItem * item )

\qmlmethod void QtQuick.Controls::Menu::insertItem(int index, Item item)

Inserts item at index. The menu does not take ownership of the newly inserted item.

See also
{Dynamically Generating Menu Items}

Definition at line 1438 of file qquickmenu.cpp.

◆ isVisible()

bool QQuickMenu::isVisible ( ) const
overridevirtual

\qmlproperty bool QtQuick.Controls::Popup::visible

This property holds whether the popup is visible. The default value is false.

See also
open(), close(), opened

Reimplemented from QQuickPopup.

Definition at line 1717 of file qquickmenu.cpp.

◆ itemAt()

QQuickItem * QQuickMenu::itemAt ( int index) const

\qmlmethod Item QtQuick.Controls::Menu::itemAt(int index)

Returns the item at index, or null if it does not exist.

Definition at line 1410 of file qquickmenu.cpp.

◆ itemChange()

void QQuickMenu::itemChange ( QQuickItem::ItemChange change,
const QQuickItem::ItemChangeData & data )
overrideprotectedvirtual

Reimplemented from QQuickPopup.

Definition at line 2213 of file qquickmenu.cpp.

◆ keyPressEvent()

void QQuickMenu::keyPressEvent ( QKeyEvent * event)
overrideprotectedvirtual

Reimplemented from QQuickPopup.

Definition at line 2231 of file qquickmenu.cpp.

◆ moveItem()

void QQuickMenu::moveItem ( int from,
int to )

\qmlmethod void QtQuick.Controls::Menu::moveItem(int from, int to)

Moves an item from one index to another.

Definition at line 1464 of file qquickmenu.cpp.

◆ overlap()

qreal QQuickMenu::overlap ( ) const
Since
QtQuick.Controls 2.3 (Qt 5.10) \qmlproperty real QtQuick.Controls::Menu::overlap

This property holds the amount of pixels by which the menu horizontally overlaps its parent menu.

The property only has effect when the menu is used as a cascading sub-menu.

The default value is style-specific.

Note
Changing the value of the property has no effect while the menu is open.

non-native-only-property

See also
cascade

Definition at line 1946 of file qquickmenu.cpp.

◆ Q_REVISION() [1/24]

QQuickMenu::Q_REVISION ( 2 ,
3  ) const

◆ Q_REVISION() [2/24]

QQuickMenu::Q_REVISION ( 2 ,
3  )

◆ Q_REVISION() [3/24]

QQuickMenu::Q_REVISION ( 2 ,
3  )

◆ Q_REVISION() [4/24]

QQuickMenu::Q_REVISION ( 2 ,
3  ) const

◆ Q_REVISION() [5/24]

QQuickMenu::Q_REVISION ( 2 ,
3  )

◆ Q_REVISION() [6/24]

QQuickMenu::Q_REVISION ( 2 ,
3  )

◆ Q_REVISION() [7/24]

QQuickMenu::Q_REVISION ( 2 ,
3  )

◆ Q_REVISION() [8/24]

QQuickMenu::Q_REVISION ( 2 ,
3  )

◆ Q_REVISION() [9/24]

QQuickMenu::Q_REVISION ( 2 ,
3  )

◆ Q_REVISION() [10/24]

QQuickMenu::Q_REVISION ( 2 ,
3  )

◆ Q_REVISION() [11/24]

QQuickMenu::Q_REVISION ( 2 ,
3  ) const &

◆ Q_REVISION() [12/24]

QQuickMenu::Q_REVISION ( 2 ,
3  )

◆ Q_REVISION() [13/24]

QQuickMenu::Q_REVISION ( 2 ,
3  )

◆ Q_REVISION() [14/24]

QQuickMenu::Q_REVISION ( 2 ,
3  )

◆ Q_REVISION() [15/24]

QQuickMenu::Q_REVISION ( 2 ,
3  )

◆ Q_REVISION() [16/24]

QQuickMenu::Q_REVISION ( 2 ,
3  )

◆ Q_REVISION() [17/24]

QQuickMenu::Q_REVISION ( 2 ,
3  )

◆ Q_REVISION() [18/24]

QQuickMenu::Q_REVISION ( 2 ,
3  )

◆ Q_REVISION [19/24]

QQuickMenu::Q_REVISION ( 2 ,
3  )
signal

◆ Q_REVISION [20/24]

QQuickMenu::Q_REVISION ( 2 ,
3  )
signal

◆ Q_REVISION [21/24]

QQuickMenu::Q_REVISION ( 2 ,
3  )
signal

◆ Q_REVISION [22/24]

QQuickMenu::Q_REVISION ( 2 ,
3  )
signal

◆ Q_REVISION [23/24]

QQuickMenu::Q_REVISION ( 2 ,
3  )
signal

◆ Q_REVISION [24/24]

QQuickMenu::Q_REVISION ( 6 ,
5  ) const &
signal

◆ removeItem()

void QQuickMenu::removeItem ( QQuickItem * item)
Since
QtQuick.Controls 2.3 (Qt 5.10) \qmlmethod void QtQuick.Controls::Menu::removeItem(Item item)

Removes and destroys the specified item.

Definition at line 1483 of file qquickmenu.cpp.

◆ resetCascade()

void QQuickMenu::resetCascade ( )

Definition at line 1921 of file qquickmenu.cpp.

◆ setCascade()

void QQuickMenu::setCascade ( bool cascade)

Definition at line 1910 of file qquickmenu.cpp.

◆ setCurrentIndex()

void QQuickMenu::setCurrentIndex ( int index)

Definition at line 2017 of file qquickmenu.cpp.

◆ setDelegate()

void QQuickMenu::setDelegate ( QQmlComponent * delegate)

Definition at line 1989 of file qquickmenu.cpp.

◆ setIcon()

void QQuickMenu::setIcon ( const QQuickIcon & icon)

Definition at line 1878 of file qquickmenu.cpp.

◆ setOverlap()

void QQuickMenu::setOverlap ( qreal overlap)

Definition at line 1952 of file qquickmenu.cpp.

◆ setTitle()

void QQuickMenu::setTitle ( const QString & title)

Definition at line 1844 of file qquickmenu.cpp.

◆ setVisible()

void QQuickMenu::setVisible ( bool visible)
overridevirtual

Reimplemented from QQuickPopup.

Definition at line 1725 of file qquickmenu.cpp.

◆ timerEvent()

void QQuickMenu::timerEvent ( QTimerEvent * event)
overrideprotectedvirtual

This event handler can be reimplemented in a subclass to receive timer events for the object.

QChronoTimer provides higher-level interfaces to the timer functionality, and also more general information about timers. The timer event is passed in the event parameter.

See also
startTimer(), killTimer(), event()

Reimplemented from QObject.

Definition at line 2304 of file qquickmenu.cpp.

◆ title()

QString QQuickMenu::title ( ) const

\qmlproperty string QtQuick.Controls::Menu::title

This property holds the title for the menu.

The title of a menu is often displayed in the text of a menu item when the menu is a submenu, and in the text of a tool button when it is in a menubar.

Definition at line 1838 of file qquickmenu.cpp.

◆ titleChanged

void QQuickMenu::titleChanged ( const QString & title)
signal

Member Data Documentation

◆ action

QQuickAction* QQuickMenu::action

Definition at line 97 of file qquickmenu_p.h.

◆ menu

QQuickMenu* QQuickMenu::menu

Definition at line 91 of file qquickmenu_p.h.

◆ menuItem [1/4]

QQuickItem * QQuickMenu::menuItem = nullptr)

Definition at line 105 of file qquickmenu_p.h.

◆ menuItem [2/4]

const QPointF QQuickItem* QQuickMenu::menuItem = nullptr)

Definition at line 106 of file qquickmenu_p.h.

◆ menuItem [3/4]

QQuickItem* QQuickMenu::menuItem = nullptr)

Definition at line 107 of file qquickmenu_p.h.

◆ menuItem [4/4]

qreal QQuickItem* QQuickMenu::menuItem = nullptr)

Definition at line 110 of file qquickmenu_p.h.

◆ position

const QPointF& QQuickMenu::position

Definition at line 106 of file qquickmenu_p.h.

◆ x

qreal QQuickMenu::x

Definition at line 105 of file qquickmenu_p.h.

◆ y [1/2]

qreal qreal QQuickMenu::y

Definition at line 105 of file qquickmenu_p.h.

◆ y [2/2]

qreal QQuickMenu::y

Definition at line 110 of file qquickmenu_p.h.

Property Documentation

◆ cascade

bool QQuickMenu::cascade
readwrite

Definition at line 43 of file qquickmenu_p.h.

◆ contentData

QQmlListProperty< QObject > QQuickMenu::contentData
read

\qmlproperty list<QtObject> QtQuick.Controls::Menu::contentData \qmldefault

This property holds the list of content data.

The list contains all objects that have been declared in QML as children of the menu, and also items that have been dynamically added or inserted using the \l addItem() and \l insertItem() methods, respectively.

Note
Unlike contentChildren, contentData does include non-visual QML objects. It is not re-ordered when items are inserted or moved.
See also
Item::data, {Popup::}{contentChildren}

Definition at line 39 of file qquickmenu_p.h.

◆ contentModel

QVariant QQuickMenu::contentModel
read

Definition at line 38 of file qquickmenu_p.h.

◆ count

int QQuickMenu::count
read

Definition at line 42 of file qquickmenu_p.h.

◆ currentIndex

int QQuickMenu::currentIndex
readwrite

Definition at line 46 of file qquickmenu_p.h.

◆ delegate

QQmlComponent * QQuickMenu::delegate
readwrite

Definition at line 45 of file qquickmenu_p.h.

◆ icon

QQuickIcon QQuickMenu::icon
readwrite

Definition at line 48 of file qquickmenu_p.h.

◆ overlap

qreal QQuickMenu::overlap
readwrite

Definition at line 44 of file qquickmenu_p.h.

◆ title

QString QQuickMenu::title
readwrite

Definition at line 40 of file qquickmenu_p.h.


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