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
qquickmenubar_p.h
Go to the documentation of this file.
1// Copyright (C) 2017 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QQUICKMENUBAR_P_H
5#define QQUICKMENUBAR_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtQuickTemplates2/private/qquickcontainer_p.h>
19
20QT_REQUIRE_CONFIG(quicktemplates2_container);
21
23
24class QQuickMenu;
26
27class Q_QUICKTEMPLATES2_EXPORT QQuickMenuBar : public QQuickContainer
28{
30 Q_PROPERTY(QQmlComponent *delegate READ delegate WRITE setDelegate NOTIFY delegateChanged FINAL)
31 Q_PRIVATE_PROPERTY(QQuickMenuBar::d_func(), QQmlListProperty<QQuickMenu> menus READ menus NOTIFY menusChanged FINAL)
32 Q_PRIVATE_PROPERTY(QQuickMenuBar::d_func(), QQmlListProperty<QObject> contentData READ contentData FINAL)
33 QML_NAMED_ELEMENT(MenuBar)
35
36public:
37 explicit QQuickMenuBar(QQuickItem *parent = nullptr);
38
39 QQmlComponent *delegate() const;
40 void setDelegate(QQmlComponent *delegate);
41
42 Q_INVOKABLE QQuickMenu *menuAt(int index) const;
44 Q_INVOKABLE void insertMenu(int index, QQuickMenu *menu);
45 Q_INVOKABLE void removeMenu(QQuickMenu *menu);
46 Q_INVOKABLE QQuickMenu *takeMenu(int index);
47
49 void delegateChanged();
50 void menusChanged();
51
52protected:
53 bool eventFilter(QObject *object, QEvent *event) override;
54 void keyPressEvent(QKeyEvent *event) override;
55 void keyReleaseEvent(QKeyEvent *event) override;
56 void hoverLeaveEvent(QHoverEvent *event) override;
57
58 bool isContent(QQuickItem *item) const override;
59 void itemChange(QQuickItem::ItemChange change, const QQuickItem::ItemChangeData &value) override;
60 void itemAdded(int index, QQuickItem *item) override;
61 void itemMoved(int index, QQuickItem *item) override;
62 void itemRemoved(int index, QQuickItem *item) override;
63
64 QFont defaultFont() const override;
65
66#if QT_CONFIG(accessibility)
67 QAccessible::Role accessibleRole() const override;
68#endif
69
70private:
71 Q_DISABLE_COPY(QQuickMenuBar)
72 Q_DECLARE_PRIVATE(QQuickMenuBar)
73};
74
76
77#endif // QQUICKMENUBAR_P_H
\inmodule QtCore
Definition qcoreevent.h:45
\reentrant
Definition qfont.h:22
\inmodule QtGui
Definition qevent.h:246
The QKeyEvent class describes a key event.
Definition qevent.h:424
\inmodule QtCore
Definition qobject.h:103
The QQmlComponent class encapsulates a QML component definition.
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
Definition qquickitem.h:63
ItemChange
Used in conjunction with QQuickItem::itemChange() to notify the item about certain types of changes.
Definition qquickitem.h:144
Combined button and popup list for selecting options.
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLuint index
[2]
struct _cl_event * event
#define QML_NAMED_ELEMENT(NAME)
#define QML_ADDED_IN_VERSION(MAJOR, MINOR)
#define QT_REQUIRE_CONFIG(feature)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_INVOKABLE
#define Q_SIGNALS
#define Q_PRIVATE_PROPERTY(d, text)
#define explicit
QGraphicsItem * item
QMenu menu
[5]
menubar addMenu(fileMenu)
[0]
\inmodule QtQuick
Definition qquickitem.h:159