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 QQUICKDRAWER_P_H
5#define QQUICKDRAWER_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/qquickpopup_p.h>
19
20QT_BEGIN_NAMESPACE
21
22class QQuickDrawerPrivate;
23
24class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickDrawer : public QQuickPopup
25{
26 Q_OBJECT
27 Q_PROPERTY(Qt::Edge edge READ edge WRITE setEdge NOTIFY edgeChanged FINAL)
28 Q_PROPERTY(qreal position READ position WRITE setPosition NOTIFY positionChanged FINAL)
29 Q_PROPERTY(qreal dragMargin READ dragMargin WRITE setDragMargin RESET resetDragMargin NOTIFY dragMarginChanged FINAL)
30 // 2.2 (Qt 5.9)
31 Q_PROPERTY(bool interactive READ isInteractive WRITE setInteractive NOTIFY interactiveChanged FINAL REVISION(2, 2))
32 QML_NAMED_ELEMENT(Drawer)
33 QML_ADDED_IN_VERSION(2, 0)
34
35public:
36 explicit QQuickDrawer(QObject *parent = nullptr);
37
38 Qt::Edge edge() const;
39 void setEdge(Qt::Edge edge);
40
41 qreal position() const;
42 void setPosition(qreal position);
43
44 qreal dragMargin() const;
45 void setDragMargin(qreal margin);
46 void resetDragMargin();
47
48 // 2.2 (Qt 5.9)
49 bool isInteractive() const;
50 void setInteractive(bool interactive);
51
52Q_SIGNALS:
53 void edgeChanged();
54 void positionChanged();
55 void dragMarginChanged();
56 // 2.2 (Qt 5.9)
57 Q_REVISION(2, 2) void interactiveChanged();
58
59protected:
60 bool childMouseEventFilter(QQuickItem *child, QEvent *event) override;
61 void mouseMoveEvent(QMouseEvent *event) override;
62 bool overlayEvent(QQuickItem *item, QEvent *event) override;
63#if QT_CONFIG(quicktemplates2_multitouch)
64 void touchEvent(QTouchEvent *event) override;
65#endif
66
67 void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override;
68
69private:
70 Q_DISABLE_COPY(QQuickDrawer)
71 Q_DECLARE_PRIVATE(QQuickDrawer)
72};
73
74QT_END_NAMESPACE
75
76QML_DECLARE_TYPE(QQuickDrawer)
77
78#endif // QQUICKDRAWER_P_H
79

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