![]() |
Qt 6.x
The Qt SDK
|
#include "qquickmenu_p.h"
#include "qquickmenu_p_p.h"
#include "qquickmenuitem_p_p.h"
#include "qquickmenubaritem_p.h"
#include "qquickmenubar_p.h"
#include "qquickpopupitem_p_p.h"
#include "qquickpopuppositioner_p_p.h"
#include "qquickaction_p.h"
#include <QtGui/qevent.h>
#include <QtGui/qcursor.h>
#include <QtGui/qpa/qplatformintegration.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/qquickevents_p_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 () |
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. | |
|
static |
Definition at line 556 of file qquickmenu.cpp.
References QQuickMenuPrivate::contentModel, QQmlObjectModel::count(), QQuickMenuPrivate::get(), i, item, menu, and QQuickMenuPrivate::parentMenu.
Referenced by QQuickMenuPrivate::resolveParentItem().
|
static |
Definition at line 202 of file qquickmenu.cpp.
References QPlatformIntegration::hasCapability(), QPlatformIntegration::MultipleWindows, and QGuiApplicationPrivate::platformIntegration().
Referenced by QQuickMenuPrivate::QQuickMenuPrivate(), and QQuickMenu::resetCascade().
|
static |
Menu popup that can be used as a context menu or popup menu.
\qmltype Menu \inherits Popup
! \instantiates QQuickMenu \inqmlmodule QtQuick.Controls
Menu has two main use cases: \list
When used as a context menu, the recommended way of opening the menu is to call \l popup(). Unless a position is explicitly specified, the menu is positioned at the mouse cursor on desktop platforms that have a mouse cursor available, and otherwise centered over its parent item.
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 200 of file qquickmenu.cpp.
Referenced by QQuickMenuPrivate::prepareEnterTransition().
|
static |
Definition at line 35 of file qquickmenu.cpp.
Referenced by QQuickMenuPrivate::startHoverTimer().