Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
#include <qquickmenu_p.h>
Public Member Functions | |
QQuickMenu (QObject *parent=nullptr) | |
~QQuickMenu () | |
Q_INVOKABLE QQuickItem * | itemAt (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< QObject > | contentData () |
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) |
QQmlComponent * | delegate () 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< QString > | bindableObjectName () |
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). | |
QThread * | thread () 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 > | |
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 > | |
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 QObjectList & | children () 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< QByteArray > | dynamicPropertyNames () const |
QBindingStorage * | bindingStorage () |
const QBindingStorage * | bindingStorage () const |
QObject * | parent () 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 | |
QQuickMenu * | menu |
QQuickAction * | action |
qreal | x |
qreal qreal | y |
qreal qreal QQuickItem * | menuItem = nullptr) |
const QPointF & | position |
const QPointF QQuickItem * | menuItem = nullptr) |
QQuickItem * | menuItem = nullptr) |
qreal | y |
qreal QQuickItem * | menuItem = 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 | |
QObject * | sender () 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) | |
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< QObjectData > | d_ptr |
Related Symbols inherited from QObject | |
template< class T > T | qobject_cast (const QObject *object) |
Returns the given object cast to type T if the object is of type T (or of a subclass); otherwise returns \nullptr. | |
template< typename T > T | qFindChildqFindChildren (const QObject *obj, const QString &name)() |
template< typename T > QList< T > | qFindChildrenqFindChildren (const QObject *obj, const QString &name)() |
QObjectList | |
\macro Q_CLASSINFO(Name, Value) | |
Definition at line 34 of file qquickmenu_p.h.
Definition at line 1370 of file qquickmenu.cpp.
QQuickMenu::~QQuickMenu | ( | ) |
Definition at line 1379 of file qquickmenu.cpp.
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 1420 of file qquickmenu.cpp.
bool QQuickMenu::cascade | ( | ) | const |
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.
non-native-only-property
Definition at line 1870 of file qquickmenu.cpp.
|
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 2149 of file qquickmenu.cpp.
QQmlListProperty< QObject > QQuickMenu::contentData | ( | ) |
|
overrideprotectedvirtual |
Reimplemented from QQuickPopup.
Definition at line 2158 of file qquickmenu.cpp.
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.
The model allows menu items to be statically declared as children of the menu.
Definition at line 1762 of file qquickmenu.cpp.
int QQuickMenu::count | ( | ) | const |
This property holds the number of items.
Definition at line 1994 of file qquickmenu.cpp.
int QQuickMenu::currentIndex | ( | ) | const |
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
Definition at line 1975 of file qquickmenu.cpp.
|
overrideprotectedvirtual |
Reimplemented from QQuickPopup.
Definition at line 2278 of file qquickmenu.cpp.
QQmlComponent * QQuickMenu::delegate | ( | ) | const |
This property holds the component that is used to create items to present actions.
Definition at line 1947 of file qquickmenu.cpp.
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
Definition at line 1838 of file qquickmenu.cpp.
void QQuickMenu::insertItem | ( | int | index, |
QQuickItem * | item ) |
\qmlmethod void QtQuick.Controls::Menu::insertItem(int index, Item item)
Inserts item at index.
Definition at line 1431 of file qquickmenu.cpp.
|
overridevirtual |
\qmlproperty bool QtQuick.Controls::Popup::visible
This property holds whether the popup is visible. The default value is false
.
Reimplemented from QQuickPopup.
Definition at line 1704 of file qquickmenu.cpp.
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 1409 of file qquickmenu.cpp.
|
overrideprotectedvirtual |
Reimplemented from QQuickPopup.
Definition at line 2175 of file qquickmenu.cpp.
Reimplemented from QQuickPopup.
Definition at line 2193 of file qquickmenu.cpp.
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 1457 of file qquickmenu.cpp.
qreal QQuickMenu::overlap | ( | ) | const |
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.
non-native-only-property
Definition at line 1912 of file qquickmenu.cpp.
QQuickMenu::Q_REVISION | ( | 2 | , |
3 | ) const |
QQuickMenu::Q_REVISION | ( | 2 | , |
3 | ) |
QQuickMenu::Q_REVISION | ( | 2 | , |
3 | ) |
QQuickMenu::Q_REVISION | ( | 2 | , |
3 | ) const |
QQuickMenu::Q_REVISION | ( | 2 | , |
3 | ) |
QQuickMenu::Q_REVISION | ( | 2 | , |
3 | ) |
QQuickMenu::Q_REVISION | ( | 2 | , |
3 | ) |
QQuickMenu::Q_REVISION | ( | 2 | , |
3 | ) |
QQuickMenu::Q_REVISION | ( | 2 | , |
3 | ) |
QQuickMenu::Q_REVISION | ( | 2 | , |
3 | ) |
QQuickMenu::Q_REVISION | ( | 2 | , |
3 | ) const & |
QQuickMenu::Q_REVISION | ( | 2 | , |
3 | ) |
QQuickMenu::Q_REVISION | ( | 2 | , |
3 | ) |
QQuickMenu::Q_REVISION | ( | 2 | , |
3 | ) |
QQuickMenu::Q_REVISION | ( | 2 | , |
3 | ) |
QQuickMenu::Q_REVISION | ( | 2 | , |
3 | ) |
QQuickMenu::Q_REVISION | ( | 2 | , |
3 | ) |
QQuickMenu::Q_REVISION | ( | 2 | , |
3 | ) |
|
signal |
|
signal |
|
signal |
|
signal |
|
signal |
|
signal |
void QQuickMenu::removeItem | ( | QQuickItem * | item | ) |
Removes and destroys the specified item.
Definition at line 1476 of file qquickmenu.cpp.
void QQuickMenu::resetCascade | ( | ) |
Definition at line 1887 of file qquickmenu.cpp.
void QQuickMenu::setCascade | ( | bool | cascade | ) |
Definition at line 1876 of file qquickmenu.cpp.
void QQuickMenu::setCurrentIndex | ( | int | index | ) |
Definition at line 1981 of file qquickmenu.cpp.
void QQuickMenu::setDelegate | ( | QQmlComponent * | delegate | ) |
Definition at line 1953 of file qquickmenu.cpp.
void QQuickMenu::setIcon | ( | const QQuickIcon & | icon | ) |
Definition at line 1844 of file qquickmenu.cpp.
Definition at line 1918 of file qquickmenu.cpp.
Definition at line 1810 of file qquickmenu.cpp.
|
overridevirtual |
Reimplemented from QQuickPopup.
Definition at line 1712 of file qquickmenu.cpp.
|
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.
Reimplemented from QObject.
Definition at line 2266 of file qquickmenu.cpp.
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 1804 of file qquickmenu.cpp.
QQuickAction* QQuickMenu::action |
Definition at line 96 of file qquickmenu_p.h.
QQuickMenu* QQuickMenu::menu |
Definition at line 90 of file qquickmenu_p.h.
QQuickItem * QQuickMenu::menuItem = nullptr) |
Definition at line 104 of file qquickmenu_p.h.
const QPointF QQuickItem* QQuickMenu::menuItem = nullptr) |
Definition at line 105 of file qquickmenu_p.h.
QQuickItem* QQuickMenu::menuItem = nullptr) |
Definition at line 106 of file qquickmenu_p.h.
qreal QQuickItem* QQuickMenu::menuItem = nullptr) |
Definition at line 109 of file qquickmenu_p.h.
const QPointF& QQuickMenu::position |
Definition at line 105 of file qquickmenu_p.h.
qreal QQuickMenu::x |
Definition at line 104 of file qquickmenu_p.h.
Definition at line 104 of file qquickmenu_p.h.
qreal QQuickMenu::y |
Definition at line 109 of file qquickmenu_p.h.
|
readwrite |
Definition at line 42 of file qquickmenu_p.h.
|
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.
contentChildren
, contentData
does include non-visual QML objects. It is not re-ordered when items are inserted or moved.Definition at line 38 of file qquickmenu_p.h.
|
read |
Definition at line 37 of file qquickmenu_p.h.
|
read |
Definition at line 41 of file qquickmenu_p.h.
|
readwrite |
Definition at line 45 of file qquickmenu_p.h.
|
readwrite |
Definition at line 44 of file qquickmenu_p.h.
|
readwrite |
Definition at line 47 of file qquickmenu_p.h.
|
readwrite |
Definition at line 43 of file qquickmenu_p.h.
|
readwrite |
Definition at line 39 of file qquickmenu_p.h.