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 QQUICKOVERLAY_P_P_H
5#define QQUICKOVERLAY_P_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/qquickoverlay_p.h>
19
20#include <QtQuick/private/qquickitem_p.h>
21#include <QtQuick/private/qquickitemchangelistener_p.h>
22
23#include <QtCore/qpointer.h>
24
25QT_BEGIN_NAMESPACE
26
27class QQuickPopup;
28
29class Q_AUTOTEST_EXPORT QQuickOverlayPrivate : public QQuickItemPrivate,
30 public QQuickItemChangeListener
31{
32public:
33 Q_DECLARE_PUBLIC(QQuickOverlay)
34
35 static QQuickOverlayPrivate *get(QQuickOverlay *overlay)
36 {
37 return overlay->d_func();
38 }
39
40 bool startDrag(QEvent *event, const QPointF &pos);
41 bool handlePress(QQuickItem *source, QEvent *event, QQuickPopup *target);
42 bool handleMove(QQuickItem *source, QEvent *event, QQuickPopup *target);
43 bool handleRelease(QQuickItem *source, QEvent *event, QQuickPopup *target);
44
45 bool handleMouseEvent(QQuickItem *source, QMouseEvent *event, QQuickPopup *target = nullptr);
46 bool handleHoverEvent(QQuickItem *source, QHoverEvent *event, QQuickPopup *target = nullptr);
47#if QT_CONFIG(quicktemplates2_multitouch)
48 bool handleTouchEvent(QQuickItem *source, QTouchEvent *event, QQuickPopup *target = nullptr);
49#endif
50
51 void addPopup(QQuickPopup *popup);
52 void removePopup(QQuickPopup *popup);
53 void setMouseGrabberPopup(QQuickPopup *popup);
54
55 QList<QQuickPopup *> stackingOrderPopups() const;
56 QList<QQuickPopup *> stackingOrderDrawers() const;
57
58 void itemGeometryChanged(QQuickItem *item, QQuickGeometryChange change, const QRectF &diff) override;
59 void itemRotationChanged(QQuickItem *item) override;
60
61 void updateGeometry();
62
63 QQmlComponent *modal = nullptr;
64 QQmlComponent *modeless = nullptr;
65 QList<QQuickPopup *> allPopups;
66 // Store drawers as QQuickPopup instead of QQuickDrawer because they're no longer
67 // QQuickDrawer by the time removePopup is called.
68 QList<QQuickPopup *> allDrawers;
69 QPointer<QQuickPopup> mouseGrabberPopup;
70 QPointer<QQuickItem> lastActiveFocusItem;
71};
72
73QT_END_NAMESPACE
74
75#endif // QQUICKOVERLAY_P_P_H
76

Provided by KDAB

Privacy Policy
Learn to use CMake with our Intro Training
Find out more

source code of qtdeclarative/src/quicktemplates/qquickoverlay_p_p.h