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
qquickmenuitem_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 QQUICKMENUITEM_P_H
5#define QQUICKMENUITEM_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#include <QtQmlModels/private/qtqmlmodelsglobal_p.h>
20
21QT_REQUIRE_CONFIG(qml_object_model);
22
24
25class QQuickMenu;
27
28class Q_QUICKTEMPLATES2_EXPORT QQuickMenuItem : public QQuickAbstractButton
29{
31 Q_PROPERTY(bool highlighted READ isHighlighted WRITE setHighlighted NOTIFY highlightedChanged FINAL)
32 // 2.3 (Qt 5.10)
33 Q_PROPERTY(QQuickItem *arrow READ arrow WRITE setArrow NOTIFY arrowChanged FINAL REVISION(2, 3))
34 Q_PROPERTY(QQuickMenu *menu READ menu NOTIFY menuChanged FINAL REVISION(2, 3))
35 Q_PROPERTY(QQuickMenu *subMenu READ subMenu NOTIFY subMenuChanged FINAL REVISION(2, 3))
36 Q_CLASSINFO("DeferredPropertyNames", "arrow,background,contentItem,indicator")
37 QML_NAMED_ELEMENT(MenuItem)
39
40public:
41 explicit QQuickMenuItem(QQuickItem *parent = nullptr);
42
43 bool isHighlighted() const;
44 void setHighlighted(bool highlighted);
45
46 // 2.3 (Qt 5.10)
47 QQuickItem *arrow() const;
48 void setArrow(QQuickItem *arrow);
49
50 QQuickMenu *menu() const;
51 QQuickMenu *subMenu() const;
52
54 void triggered();
55 void highlightedChanged();
56 // 2.3 (Qt 5.10)
57 Q_REVISION(2, 3) void arrowChanged();
58 Q_REVISION(2, 3) void menuChanged();
59 Q_REVISION(2, 3) void subMenuChanged();
60
61protected:
62 void componentComplete() 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(QQuickMenuItem)
72 Q_DECLARE_PRIVATE(QQuickMenuItem)
73};
74
76
77#endif // QQUICKMENUITEM_P_H
\reentrant
Definition qfont.h:22
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
Definition qquickitem.h:63
Combined button and popup list for selecting options.
#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_REVISION(...)
#define Q_CLASSINFO(name, value)
#define Q_SIGNALS
#define explicit
QMenu menu
[5]