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
qquickcontextmenu_p.h
Go to the documentation of this file.
1// Copyright (C) 2024 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 QQUICKCONTEXTMENU_P_H
6#define QQUICKCONTEXTMENU_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 <QtCore/qobject.h>
20#include <QtQml/qqmlregistration.h>
21#include <QtQuickTemplates2/private/qtquicktemplates2global_p.h>
22
23QT_BEGIN_NAMESPACE
24
25class QQuickContextMenuPrivate;
26class QQuickMenu;
27
28class Q_QUICKTEMPLATES2_EXPORT QQuickContextMenu : public QObject, public QQmlParserStatus
29{
30 Q_OBJECT
31 Q_INTERFACES(QQmlParserStatus)
32 Q_PROPERTY(QQuickMenu *menu READ menu WRITE setMenu NOTIFY menuChanged FINAL)
33 Q_CLASSINFO("DeferredPropertyNames", "menu")
34 QML_NAMED_ELEMENT(ContextMenu)
35 QML_ATTACHED(QQuickContextMenu)
36 QML_UNCREATABLE("")
37 QML_ADDED_IN_VERSION(6, 9)
38
39public:
40 explicit QQuickContextMenu(QObject *parent = nullptr);
41
42 static QQuickContextMenu *qmlAttachedProperties(QObject *object);
43
44 QQuickMenu *menu() const;
45 void setMenu(QQuickMenu *menu);
46
47Q_SIGNALS:
48 void menuChanged();
49 void requested(QPointF position);
50
51protected:
52 bool event(QEvent *) override;
53
54private:
55 Q_DECLARE_PRIVATE(QQuickContextMenu)
56
57 void classBegin() override;
58 void componentComplete() override;
59};
60
61QT_END_NAMESPACE
62
63#endif // QQUICKCONTEXTMENU_P_H
static const QString menuPropertyName