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
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()
 
- 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)
 
void popup (QQuickItem *menuItem=nullptr)
 
void popup (const QPointF &pos, QQuickItem *menuItem=nullptr)
 
 Q_REVISION (2, 3) Q_INVOKABLE void popup(QQmlV4FunctionPtr args)
 
 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 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
 

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

Constructor & Destructor Documentation

◆ QQuickMenu()

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

Definition at line 732 of file qquickmenu.cpp.

References QObject::connect(), QQmlInstanceModel::countChanged(), and d.

+ Here is the call graph for this function:

◆ ~QQuickMenu()

QQuickMenu::~QQuickMenu ( )

Definition at line 741 of file qquickmenu.cpp.

References child, QObject::children(), QQuickItemPrivate::Children, d, QQuickItemPrivate::Geometry, QQuickItemPrivate::get(), and QQuickItemPrivate::SiblingOrder.

+ Here is the call graph for this function:

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.

Definition at line 776 of file qquickmenu.cpp.

References d, insertItem(), and item.

+ Here is the call graph for this function:

◆ 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.
See also
overlap

Definition at line 1175 of file qquickmenu.cpp.

References d.

◆ 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 1454 of file qquickmenu.cpp.

References QQuickPopup::componentComplete(), and d.

+ Here is the call graph for this function:

◆ contentData()

QQmlListProperty< QObject > QQuickMenu::contentData ( )

◆ contentItemChange()

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

Reimplemented from QQuickPopup.

Definition at line 1461 of file qquickmenu.cpp.

References QQuickItemPrivate::Children, QQuickPopup::contentItemChange(), d, QQuickItemPrivate::Geometry, QQuickItemPrivate::get(), and QQuickGeometryChange::Width.

+ Here is the call graph for this function:

◆ 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 {
}
}
QQuickMenu * menu
QVariant contentModel
QQuickItem * contentItem
GLenum GLuint id
[7]
QSqlQueryModel * model
[16]

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

Definition at line 1073 of file qquickmenu.cpp.

References d, and QVariant::fromValue().

+ Here is the call graph for this function:

◆ 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 1292 of file qquickmenu.cpp.

References d.

◆ 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.

See also
MenuItem::highlighted

Definition at line 1273 of file qquickmenu.cpp.

References d.

◆ defaultFont()

QFont QQuickMenu::defaultFont ( ) const
overrideprotectedvirtual

Reimplemented from QQuickPopup.

Definition at line 1560 of file qquickmenu.cpp.

References QQuickTheme::font(), and QQuickTheme::Menu.

+ Here is the call graph for this function:

◆ 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" }
}
QString text
See also
Action

Definition at line 1247 of file qquickmenu.cpp.

References d.

◆ 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

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

Definition at line 1145 of file qquickmenu.cpp.

References d.

◆ insertItem()

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

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

Inserts item at index.

Definition at line 787 of file qquickmenu.cpp.

References count, d, and item.

Referenced by addItem().

+ Here is the caller graph for this function:

◆ 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 765 of file qquickmenu.cpp.

References d.

◆ itemChange()

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

Reimplemented from QQuickPopup.

Definition at line 1478 of file qquickmenu.cpp.

References d, QQuickPopup::itemChange(), QQuickItem::ItemVisibleHasChanged, and Qt::OtherFocusReason.

+ Here is the call graph for this function:

◆ keyPressEvent()

void QQuickMenu::keyPressEvent ( QKeyEvent * event)
overrideprotectedvirtual

Reimplemented from QQuickPopup.

Definition at line 1492 of file qquickmenu.cpp.

References QQuickPopup::close(), d, QQuickMenuPrivate::get(), Qt::Key_Alt, Qt::Key_Down, Qt::Key_Left, Qt::Key_Right, Qt::Key_Up, QQuickPopup::keyPressEvent(), QKeySequence::mnemonic(), popup(), and QStringLiteral.

+ Here is the call graph for this function:

◆ 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 812 of file qquickmenu.cpp.

References d.

◆ 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.
See also
cascade

Definition at line 1215 of file qquickmenu.cpp.

References d.

◆ popup() [1/2]

void QQuickMenu::popup ( const QPointF & pos,
QQuickItem * menuItem = nullptr )

Definition at line 1316 of file qquickmenu.cpp.

References d, QQuickPopup::open(), Qt::PopupFocusReason, pos, and setPosition().

+ Here is the call graph for this function:

◆ popup() [2/2]

void QQuickMenu::popup ( QQuickItem * menuItem = nullptr)

Definition at line 1298 of file qquickmenu.cpp.

References d, QPlatformIntegration::MultipleWindows, QGuiApplicationPrivate::platformIntegration(), popup(), pos, and QCursor::pos().

Referenced by keyPressEvent(), and popup().

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

◆ Q_REVISION() [1/19]

QQuickMenu::Q_REVISION ( 2 ,
3  ) const

◆ Q_REVISION() [2/19]

QQuickMenu::Q_REVISION ( 2 ,
3  )

◆ Q_REVISION() [3/19]

QQuickMenu::Q_REVISION ( 2 ,
3  )

◆ Q_REVISION() [4/19]

QQuickMenu::Q_REVISION ( 2 ,
3  ) const

◆ Q_REVISION() [5/19]

QQuickMenu::Q_REVISION ( 2 ,
3  )

◆ Q_REVISION() [6/19]

QQuickMenu::Q_REVISION ( 2 ,
3  )

◆ Q_REVISION() [7/19]

QQuickMenu::Q_REVISION ( 2 ,
3  )

◆ Q_REVISION() [8/19]

QQuickMenu::Q_REVISION ( 2 ,
3  )

◆ Q_REVISION() [9/19]

QQuickMenu::Q_REVISION ( 2 ,
3  )

◆ Q_REVISION() [10/19]

QQuickMenu::Q_REVISION ( 2 ,
3  )

◆ Q_REVISION() [11/19]

QQuickMenu::Q_REVISION ( 2 ,
3  )

◆ Q_REVISION() [12/19]

QQuickMenu::Q_REVISION ( 2 ,
3  )

◆ Q_REVISION() [13/19]

QQuickMenu::Q_REVISION ( 2 ,
3  )

◆ Q_REVISION [14/19]

QQuickMenu::Q_REVISION ( 2 ,
3  )
signal

◆ Q_REVISION [15/19]

QQuickMenu::Q_REVISION ( 2 ,
3  )
signal

◆ Q_REVISION [16/19]

QQuickMenu::Q_REVISION ( 2 ,
3  )
signal

◆ Q_REVISION [17/19]

QQuickMenu::Q_REVISION ( 2 ,
3  )
signal

◆ Q_REVISION [18/19]

QQuickMenu::Q_REVISION ( 2 ,
3  )
signal

◆ Q_REVISION [19/19]

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 831 of file qquickmenu.cpp.

References d, and item.

◆ resetCascade()

void QQuickMenu::resetCascade ( )

Definition at line 1192 of file qquickmenu.cpp.

References d, setCascade(), and shouldCascade().

+ Here is the call graph for this function:

◆ setCascade()

void QQuickMenu::setCascade ( bool cascade)

Definition at line 1181 of file qquickmenu.cpp.

References cascade, d, and emit.

Referenced by resetCascade(), and QQuickMenuPrivate::setParentMenu().

+ Here is the caller graph for this function:

◆ setCurrentIndex()

void QQuickMenu::setCurrentIndex ( int index)

Definition at line 1279 of file qquickmenu.cpp.

References d, and Qt::OtherFocusReason.

◆ setDelegate()

void QQuickMenu::setDelegate ( QQmlComponent * delegate)

Definition at line 1253 of file qquickmenu.cpp.

References d, delegate, and emit.

◆ setIcon()

void QQuickMenu::setIcon ( const QQuickIcon & icon)

Definition at line 1151 of file qquickmenu.cpp.

References d, emit, and icon.

◆ setOverlap()

void QQuickMenu::setOverlap ( qreal overlap)

Definition at line 1221 of file qquickmenu.cpp.

References d, emit, and overlap.

◆ setTitle()

void QQuickMenu::setTitle ( const QString & title)

Definition at line 1121 of file qquickmenu.cpp.

References d, emit, title, and titleChanged().

+ Here is the call graph for this function:

◆ 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 1548 of file qquickmenu.cpp.

References d, QQuickPopup::open(), and QObject::timerEvent().

+ Here is the call graph for this function:

◆ 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 1115 of file qquickmenu.cpp.

References d.

◆ titleChanged

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

Referenced by QQuickMenuBarItem::setMenu(), QQuickMenuItemPrivate::setSubMenu(), and setTitle().

+ Here is the caller graph for this function:

Member Data Documentation

◆ action

QQuickAction* QQuickMenu::action

Definition at line 96 of file qquickmenu_p.h.

◆ menu

QQuickMenu* QQuickMenu::menu

Definition at line 90 of file qquickmenu_p.h.

Property Documentation

◆ cascade

bool QQuickMenu::cascade
readwrite

Definition at line 42 of file qquickmenu_p.h.

Referenced by QQuickMenuPrivate::onItemHovered(), and setCascade().

◆ 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 38 of file qquickmenu_p.h.

◆ contentModel

QVariant QQuickMenu::contentModel
read

Definition at line 37 of file qquickmenu_p.h.

◆ count

int QQuickMenu::count
read

Definition at line 41 of file qquickmenu_p.h.

Referenced by insertItem().

◆ currentIndex

int QQuickMenu::currentIndex
readwrite

Definition at line 45 of file qquickmenu_p.h.

◆ delegate

QQmlComponent * QQuickMenu::delegate
readwrite

Definition at line 44 of file qquickmenu_p.h.

Referenced by setDelegate().

◆ icon

QQuickIcon QQuickMenu::icon
readwrite

Definition at line 47 of file qquickmenu_p.h.

Referenced by setIcon().

◆ overlap

qreal QQuickMenu::overlap
readwrite

Definition at line 43 of file qquickmenu_p.h.

Referenced by setOverlap().

◆ title

QString QQuickMenu::title
readwrite

Definition at line 39 of file qquickmenu_p.h.

Referenced by QQuickMenuBarItem::setMenu(), and setTitle().


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