Obsolete Members for Menu
The following members of QML type Menu are obsolete. They are provided to keep old source code working. We strongly advise against using them in new code.
Methods
- Action actionAt(int index)
- void addAction(Action action)
- void addItem(Item item)
- void addMenu(Menu menu)
- void dismiss()
- void insertAction(int index, Action action)
- void insertItem(int index, Item item)
- void insertMenu(int index, Menu menu)
- Item itemAt(int index)
- Menu menuAt(int index)
- void moveItem(int from, int to)
- void popup(MenuItem item = null)
- void popup(Item parent, MenuItem item = null)
- void popup(point pos, MenuItem item = null)
- void popup(Item parent, point pos, MenuItem item = null)
- void popup(real x, real y, MenuItem item = null)
- void popup(Item parent, real x, real y, MenuItem item = null)
- void removeAction(Action action)
- void removeItem(Item item)
- void removeMenu(Menu menu)
- Action takeAction(int index)
- MenuItem takeItem(int index)
- Menu takeMenu(int index)
Method Documentation
Opens the menu at the specified position x, y in the popups coordinate system, that is, a coordinate relative to its parent item.
The menu can be optionally aligned to a specific menu item.
This documentation was introduced in QtQuick.Controls 2.3 (Qt 5.10).
See also dismiss() and Popup::open().
Opens the menu at the specified position pos in the popups coordinate system, that is, a coordinate relative to its parent item.
The menu can be optionally aligned to a specific menu item.
This documentation was introduced in QtQuick.Controls 2.3 (Qt 5.10).
See also Popup::open().
Opens the menu at the mouse cursor on desktop platforms that have a mouse cursor available, and otherwise centers the menu over its parent item.
The menu can be optionally aligned to a specific menu item.
This documentation was introduced in QtQuick.Controls 2.3 (Qt 5.10).
See also Popup::open().
Returns the action at index, or null
if the index is not valid or there is no action at the specified index.
This method was introduced in QtQuick.Controls 2.3 (Qt 5.10).
void addAction(Action action) |
Adds action to the end of this menu.
This method was introduced in QtQuick.Controls 2.3 (Qt 5.10).
void addItem(Item item) |
Adds item to the end of the list of items.
void addMenu(Menu menu) |
Adds menu as a sub-menu to the end of this menu.
This method was introduced in QtQuick.Controls 2.3 (Qt 5.10).
Closes all menus in the hierarchy that this menu belongs to.
Note: Unlike close() that only closes a menu and its sub-menus, dismiss()
closes the whole hierarchy of menus, including the parent menus. In practice, close()
is suitable e.g. for implementing navigation in a hierarchy of menus, and dismiss()
is the appropriate method for closing the whole hierarchy of menus.
This method was introduced in QtQuick.Controls 2.3 (Qt 5.10).
See also popup() and Popup::close().
Inserts action at index. The index is within all items in the menu.
This method was introduced in QtQuick.Controls 2.3 (Qt 5.10).
Inserts menu as a sub-menu at index. The index is within all items in the menu.
This method was introduced in QtQuick.Controls 2.3 (Qt 5.10).
Returns the sub-menu at index, or null
if the index is not valid or there is no sub-menu at the specified index.
This method was introduced in QtQuick.Controls 2.3 (Qt 5.10).
void removeAction(Action action) |
Removes and destroys the specified action.
This method was introduced in QtQuick.Controls 2.3 (Qt 5.10).
void removeItem(Item item) |
Removes and destroys the specified item.
This method was introduced in QtQuick.Controls 2.3 (Qt 5.10).
void removeMenu(Menu menu) |
Removes and destroys the specified menu.
This method was introduced in QtQuick.Controls 2.3 (Qt 5.10).
Removes and returns the action at index. The index is within all items in the menu.
Note: The ownership of the action is transferred to the caller.
This method was introduced in QtQuick.Controls 2.3 (Qt 5.10).
Removes and returns the item at index.
Note: The ownership of the item is transferred to the caller.
This method was introduced in QtQuick.Controls 2.3 (Qt 5.10).
Removes and returns the menu at index. The index is within all items in the menu.
Note: The ownership of the menu is transferred to the caller.
This method was introduced in QtQuick.Controls 2.3 (Qt 5.10).
© 2021 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.