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