![]() |
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"
#include "qquickmenu_p_p.h"
#include "qquickmenuitem_p_p.h"
#include <private/qtquicktemplates2-config_p.h>
#include "qquickmenuseparator_p.h"
#include "qquicknativemenuitem_p.h"
#include "qquickoverlay_p.h"
#include "qquickoverlay_p_p.h"
#include "qquickpopupitem_p_p.h"
#include "qquickpopuppositioner_p_p.h"
#include "qquickaction_p.h"
#include <QtCore/qloggingcategory.h>
#include <QtGui/qevent.h>
#include <QtGui/qcursor.h>
#include <QtGui/qpa/qplatformintegration.h>
#include <QtGui/qpa/qplatformtheme.h>
#include <QtGui/private/qhighdpiscaling_p.h>
#include <QtGui/private/qguiapplication_p.h>
#include <QtQml/qqmlcontext.h>
#include <QtQml/qqmlcomponent.h>
#include <QtQml/private/qqmlengine_p.h>
#include <QtQml/private/qv4scopedvalue_p.h>
#include <QtQml/private/qv4variantobject_p.h>
#include <QtQml/private/qv4qobjectwrapper_p.h>
#include <private/qqmlobjectmodel_p.h>
#include <QtQuick/private/qquickitem_p.h>
#include <QtQuick/private/qquickitemchangelistener_p.h>
#include <QtQuick/private/qquickitemview_p_p.h>
#include <QtQuick/private/qquickevents_p_p.h>
#include <QtQuick/private/qquicklistview_p.h>
#include <QtQuick/private/qquickrendercontrol_p.h>
#include <QtQuick/private/qquickwindow_p.h>
#include "moc_qquickmenu_p.cpp"
Go to the source code of this file.
Classes | |
class | QQuickMenuPositioner |
Functions | |
static bool | shouldCascade () |
QString | nativeMenuItemListToString (const QList< QQuickNativeMenuItem * > &nativeItems) |
static QWindow * | effectiveWindow (QWindow *window, QPoint *offset) |
static QQuickItem * | findParentMenuItem (QQuickMenu *subMenu) |
Variables | |
static QT_BEGIN_NAMESPACE const int | SUBMENU_DELAY = 225 |
static const QQuickPopup::ClosePolicy | cascadingSubMenuClosePolicy = QQuickPopup::CloseOnEscape | QQuickPopup::CloseOnPressOutsideParent |
Menu popup that can be used as a context menu or popup menu. |
Definition at line 527 of file qquickmenu.cpp.
|
static |
Definition at line 1180 of file qquickmenu.cpp.
QString nativeMenuItemListToString | ( | const QList< QQuickNativeMenuItem * > & | nativeItems | ) |
Definition at line 427 of file qquickmenu.cpp.
|
static |
Definition at line 269 of file qquickmenu.cpp.
|
static |
Menu popup that can be used as a context menu or popup menu.
\qmltype Menu \inherits Popup
! \nativetype QQuickMenu \inqmlmodule QtQuick.Controls
\table \row
Menu has two main use cases: \list
For context menus, see \l {Context Menus}.
When used as a popup menu, it is easiest to specify the position by specifying the desired \l {Popup::}{x} and \l {Popup::}{y} coordinates using the respective properties, and call \l {Popup::}{open()} to open the menu.
If the button should also close the menu when clicked, use the Popup.CloseOnPressOutsideParent
flag:
Since QtQuick.Controls 2.3 (Qt 5.10), it is also possible to create sub-menus and declare Action objects inside Menu:
Sub-menus are \l {cascade}{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.
Typically, menu items are statically declared as children of the menu, but Menu also provides API to \l {addItem}{add}, \l {insertItem}{insert}, \l {moveItem}{move} and \l {removeItem}{remove} items dynamically. The items in a menu can be accessed using \l itemAt() or \l {Popup::}{contentChildren}.
Although \l {MenuItem}{MenuItems} are most commonly used with Menu, it can contain any type of item.
Definition at line 267 of file qquickmenu.cpp.
|
static |
Definition at line 52 of file qquickmenu.cpp.