Qt 6.x
The Qt SDK
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
qquickmenubaritem_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 QQUICKMENUBARITEM_P_H
5#define QQUICKMENUBARITEM_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/qquickabstractbutton_p.h>
19
21
22class QQuickMenu;
23class QQuickMenuBar;
25
26class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickMenuBarItem : public QQuickAbstractButton
27{
29 Q_PROPERTY(QQuickMenuBar *menuBar READ menuBar NOTIFY menuBarChanged FINAL)
30 Q_PROPERTY(QQuickMenu *menu READ menu WRITE setMenu NOTIFY menuChanged FINAL)
31 Q_PROPERTY(bool highlighted READ isHighlighted WRITE setHighlighted NOTIFY highlightedChanged FINAL)
32 QML_NAMED_ELEMENT(MenuBarItem)
34
35public:
36 explicit QQuickMenuBarItem(QQuickItem *parent = nullptr);
37
38 QQuickMenuBar *menuBar() const;
39
40 QQuickMenu *menu() const;
41 void setMenu(QQuickMenu *menu);
42
43 bool isHighlighted() const;
44 void setHighlighted(bool highlighted);
45
47 void triggered();
51
52protected:
53 bool event(QEvent *event) override;
54 void keyPressEvent(QKeyEvent *event) override;
55 void keyReleaseEvent(QKeyEvent *event) override;
56
57 void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override;
58
59 QFont defaultFont() const override;
60
61#if QT_CONFIG(accessibility)
62 QAccessible::Role accessibleRole() const override;
63#endif
64
65private:
66 Q_DISABLE_COPY(QQuickMenuBarItem)
67 Q_DECLARE_PRIVATE(QQuickMenuBarItem)
68};
69
71
73
74#endif // QQUICKMENUBARITEM_P_H
\inmodule QtCore
Definition qcoreevent.h:45
\reentrant
Definition qfont.h:20
The QKeyEvent class describes a key event.
Definition qevent.h:423
void keyPressEvent(QKeyEvent *event) override
This event handler can be reimplemented in a subclass to receive key press events for an item.
void keyReleaseEvent(QKeyEvent *event) override
This event handler can be reimplemented in a subclass to receive key release events for an item.
virtual QFont defaultFont() const
void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
Definition qquickitem.h:64
void highlightedChanged()
\inmodule QtCore\reentrant
Definition qrect.h:483
Combined button and popup list for selecting options.
struct _cl_event * event
#define QML_DECLARE_TYPE(TYPE)
Definition qqml.h:19
#define QML_NAMED_ELEMENT(NAME)
#define QML_ADDED_IN_VERSION(MAJOR, MINOR)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_SIGNALS
QMenu menu
[5]
QMenuBar * menuBar
[0]
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent