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
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
20QT_REQUIRE_CONFIG(quicktemplates2_container);
21
23
24class QQuickMenu;
25class QQuickMenuBar;
27
28class Q_QUICKTEMPLATES2_EXPORT QQuickMenuBarItem : public QQuickAbstractButton
29{
31 Q_PROPERTY(QQuickMenuBar *menuBar READ menuBar NOTIFY menuBarChanged FINAL)
32 Q_PROPERTY(QQuickMenu *menu READ menu WRITE setMenu NOTIFY menuChanged FINAL)
33 Q_PROPERTY(bool highlighted READ isHighlighted WRITE setHighlighted NOTIFY highlightedChanged FINAL)
34 QML_NAMED_ELEMENT(MenuBarItem)
36
37public:
38 explicit QQuickMenuBarItem(QQuickItem *parent = nullptr);
39
40 QQuickMenuBar *menuBar() const;
41
42 QQuickMenu *menu() const;
43 void setMenu(QQuickMenu *menu);
44
45 bool isHighlighted() const;
46 void setHighlighted(bool highlighted);
47
49 void triggered();
50 void menuBarChanged();
51 void menuChanged();
52 void highlightedChanged();
53
54protected:
55 bool event(QEvent *event) override;
56 void keyPressEvent(QKeyEvent *event) override;
57 void keyReleaseEvent(QKeyEvent *event) override;
58
59 void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override;
60
61 QFont defaultFont() const override;
62
63#if QT_CONFIG(accessibility)
64 QAccessible::Role accessibleRole() const override;
65#endif
66
67private:
68 Q_DISABLE_COPY(QQuickMenuBarItem)
69 Q_DECLARE_PRIVATE(QQuickMenuBarItem)
70};
71
73
74#endif // QQUICKMENUBARITEM_P_H
\inmodule QtCore
Definition qcoreevent.h:45
\reentrant
Definition qfont.h:22
The QKeyEvent class describes a key event.
Definition qevent.h:424
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
Definition qquickitem.h:63
\inmodule QtCore\reentrant
Definition qrect.h:484
Combined button and popup list for selecting options.
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_SIGNALS
#define explicit
QMenu menu
[5]
QMenuBar * menuBar
[0]