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
qquickoverlay_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 QQUICKOVERLAY_P_H
6#define QQUICKOVERLAY_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 <QtQuick/qquickitem.h>
20#include <QtQuickTemplates2/private/qquickabstractbutton_p.h>
21
23
24class QQmlComponent;
25class QQuickOverlayPrivate;
26class QQuickOverlayAttached;
28
29class Q_QUICKTEMPLATES2_EXPORT QQuickOverlay : public QQuickItem
30{
31 Q_OBJECT
32 Q_PROPERTY(QQmlComponent *modal READ modal WRITE setModal NOTIFY modalChanged FINAL)
33 Q_PROPERTY(QQmlComponent *modeless READ modeless WRITE setModeless NOTIFY modelessChanged FINAL)
34 QML_NAMED_ELEMENT(Overlay)
35 QML_ATTACHED(QQuickOverlayAttached)
36 QML_UNCREATABLE("")
37 QML_ADDED_IN_VERSION(2, 3)
38
39public:
40 explicit QQuickOverlay(QQuickItem *parent = nullptr);
41 ~QQuickOverlay();
42
43 QQmlComponent *modal() const;
44 void setModal(QQmlComponent *modal);
45
46 QQmlComponent *modeless() const;
47 void setModeless(QQmlComponent *modeless);
48
49 static QQuickOverlay *overlay(QQuickWindow *window);
50
51 static QQuickOverlayAttached *qmlAttachedProperties(QObject *object);
52
53Q_SIGNALS:
54 void modalChanged();
55 void modelessChanged();
56 void pressed();
57 void released();
58
59protected:
60 void itemChange(ItemChange change, const ItemChangeData &data) override;
61 void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override;
62
63 void mousePressEvent(QMouseEvent *event) override;
64 void mouseMoveEvent(QMouseEvent *event) override;
65 void mouseReleaseEvent(QMouseEvent *event) override;
66#if QT_CONFIG(quicktemplates2_multitouch)
67 void touchEvent(QTouchEvent *event) override;
68#endif
69#if QT_CONFIG(wheelevent)
70 void wheelEvent(QWheelEvent *event) override;
71#endif
72 bool childMouseEventFilter(QQuickItem *item, QEvent *event) override;
73 bool eventFilter(QObject *object, QEvent *event) override;
74
75private:
76 Q_DISABLE_COPY(QQuickOverlay)
77 Q_DECLARE_PRIVATE(QQuickOverlay)
78};
79
80class Q_QUICKTEMPLATES2_EXPORT QQuickOverlayAttached : public QObject
81{
82 Q_OBJECT
83 Q_PROPERTY(QQuickOverlay *overlay READ overlay NOTIFY overlayChanged FINAL)
84 Q_PROPERTY(QQmlComponent *modal READ modal WRITE setModal NOTIFY modalChanged FINAL)
85 Q_PROPERTY(QQmlComponent *modeless READ modeless WRITE setModeless NOTIFY modelessChanged FINAL)
86
87public:
88 explicit QQuickOverlayAttached(QObject *parent = nullptr);
89
90 QQuickOverlay *overlay() const;
91
92 QQmlComponent *modal() const;
93 void setModal(QQmlComponent *modal);
94
95 QQmlComponent *modeless() const;
96 void setModeless(QQmlComponent *modeless);
97
98Q_SIGNALS:
99 void overlayChanged();
100 void modalChanged();
101 void modelessChanged();
102 void pressed();
103 void released();
104
105private:
106 Q_DISABLE_COPY(QQuickOverlayAttached)
107 Q_DECLARE_PRIVATE(QQuickOverlayAttached)
108};
109
110QT_END_NAMESPACE
111
112#endif // QQUICKOVERLAY_P_H
QPalette defaultPalette() const override
void setSubMenu(QQuickMenu *subMenu)
void executeArrow(bool complete=false)
QPointer< QQuickMenu > subMenu
QQuickDeferredPointer< QQuickItem > arrow
bool acceptKeyClick(Qt::Key key) const override
QQuickMenuPositioner(QQuickMenu *menu)
void reposition() override
static const QQuickPopup::ClosePolicy cascadingSubMenuClosePolicy
Menu popup that can be used as a context menu or popup menu.
static QQuickItem * findParentMenuItem(QQuickMenu *subMenu)
static bool shouldCascade()
static QWindow * effectiveWindow(QWindow *window, QPoint *offset)
QString nativeMenuItemListToString(const QList< QQuickNativeMenuItem * > &nativeItems)