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_PROPERTY(qreal implicitTextPadding READ implicitTextPadding WRITE setImplicitTextPadding NOTIFY implicitTextPaddingChanged REVISION(6, 8))
37 Q_PROPERTY(qreal textPadding READ textPadding NOTIFY textPaddingChanged REVISION(6, 8))
38 Q_CLASSINFO("DeferredPropertyNames", "arrow,background,contentItem,indicator")
39 QML_NAMED_ELEMENT(MenuItem)
41
42public:
43 explicit QQuickMenuItem(QQuickItem *parent = nullptr);
44
45 bool isHighlighted() const;
46 void setHighlighted(bool highlighted);
47
48 // 2.3 (Qt 5.10)
49 QQuickItem *arrow() const;
50 void setArrow(QQuickItem *arrow);
51
52 QQuickMenu *menu() const;
53 QQuickMenu *subMenu() const;
54
55 qreal textPadding() const;
56 qreal implicitTextPadding() const;
57 void setImplicitTextPadding(qreal newImplicitTextPadding);
58
60 void triggered();
61 void highlightedChanged();
62 // 2.3 (Qt 5.10)
63 Q_REVISION(2, 3) void arrowChanged();
64 Q_REVISION(2, 3) void menuChanged();
65 Q_REVISION(2, 3) void subMenuChanged();
66 Q_REVISION(6, 8) void implicitTextPaddingChanged();
67 Q_REVISION(6, 8) void textPaddingChanged();
68
69protected:
70 void componentComplete() override;
71
72 QFont defaultFont() const override;
73
74#if QT_CONFIG(accessibility)
75 QAccessible::Role accessibleRole() const override;
76#endif
77
78private:
79 Q_DISABLE_COPY(QQuickMenuItem)
80 Q_DECLARE_PRIVATE(QQuickMenuItem)
81};
82
83#ifndef QT_NO_DEBUG_STREAM
84Q_QUICKTEMPLATES2_EXPORT QDebug operator<<(QDebug debug, const QQuickMenuItem *menuItem);
85#endif
86
88
89#endif // QQUICKMENUITEM_P_H
\inmodule QtCore
\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)
Q_QUICKTEMPLATES2_EXPORT QDebug operator<<(QDebug debug, const QQuickMenuItem *menuItem)
#define QT_REQUIRE_CONFIG(feature)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_REVISION(...)
#define Q_CLASSINFO(name, value)
#define Q_SIGNALS
double qreal
Definition qtypes.h:187
#define explicit
QMenu menu
[5]