Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
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// Qt-Security score:significant reason:default
4
5#ifndef QQUICKMENUBARITEM_P_H
6#define QQUICKMENUBARITEM_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <QtQuickTemplates2/private/qquickabstractbutton_p.h>
20
22
23QT_BEGIN_NAMESPACE
24
25class QQuickMenu;
26class QQuickMenuBar;
28
29class Q_QUICKTEMPLATES2_EXPORT QQuickMenuBarItem : public QQuickAbstractButton
30{
31 Q_OBJECT
32 Q_PROPERTY(QQuickMenuBar *menuBar READ menuBar NOTIFY menuBarChanged FINAL)
33 Q_PROPERTY(QQuickMenu *menu READ menu WRITE setMenu NOTIFY menuChanged FINAL)
34 Q_PROPERTY(bool highlighted READ isHighlighted WRITE setHighlighted NOTIFY highlightedChanged FINAL)
35 QML_NAMED_ELEMENT(MenuBarItem)
36 QML_ADDED_IN_VERSION(2, 3)
37
38public:
39 explicit QQuickMenuBarItem(QQuickItem *parent = nullptr);
40
41 QQuickMenuBar *menuBar() const;
42
43 QQuickMenu *menu() const;
44 void setMenu(QQuickMenu *menu);
45
46 bool isHighlighted() const;
47 void setHighlighted(bool highlighted);
48
49Q_SIGNALS:
50 void triggered();
51 void menuBarChanged();
52 void menuChanged();
53 void highlightedChanged();
54
55protected:
56 bool event(QEvent *event) override;
57 void keyPressEvent(QKeyEvent *event) override;
58 void keyReleaseEvent(QKeyEvent *event) override;
59
60 void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override;
61
62 QFont defaultFont() const override;
63
64#if QT_CONFIG(accessibility)
65 QAccessible::Role accessibleRole() const override;
66#endif
67
68private:
69 Q_DISABLE_COPY(QQuickMenuBarItem)
70 Q_DECLARE_PRIVATE(QQuickMenuBarItem)
71};
72
73QT_END_NAMESPACE
74
75#endif // QQUICKMENUBARITEM_P_H
bool handleRelease(const QPointF &point, ulong timestamp) override
QPalette defaultPalette() const override
void accessiblePressAction() override
bool handlePress(const QPointF &point, ulong timestamp) override
QT_REQUIRE_CONFIG(quicktemplates2_container)