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
qquickpointerhandler_p_p.h
Go to the documentation of this file.
1// Copyright (C) 2018 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 QQUICKPOINTERHANDLER_P_H
6#define QQUICKPOINTERHANDLER_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 "qevent.h"
20
21#include <QtCore/private/qobject_p.h>
22#include <QtQuick/private/qquickevents_p_p.h>
23#include <QtQuick/private/qquickpointerhandler_p.h>
24
26
27class Q_QUICK_EXPORT QQuickPointerHandlerPrivate : public QObjectPrivate
28{
29 Q_DECLARE_PUBLIC(QQuickPointerHandler)
30
31public:
32 static QQuickPointerHandlerPrivate* get(QQuickPointerHandler *q) { return q->d_func(); }
33 static const QQuickPointerHandlerPrivate* get(const QQuickPointerHandler *q) { return q->d_func(); }
34
35 QQuickPointerHandlerPrivate();
36
37 template<typename TEventPoint>
38 bool dragOverThreshold(qreal d, Qt::Axis axis, const TEventPoint &p) const;
39
40 bool dragOverThreshold(QVector2D delta) const;
41 bool dragOverThreshold(const QEventPoint &point) const;
42
43 virtual void onParentChanged(QQuickItem * /*oldParent*/, QQuickItem * /*newParent*/) {}
44 virtual void onEnabledChanged() {}
45
46 static QVector<QObject *> &deviceDeliveryTargets(const QInputDevice *device);
47
48 QPointerEvent *currentEvent = nullptr;
49 QQuickItem *target = nullptr;
50 qreal m_margin = 0;
51 quint64 lastEventTime = 0;
52 qint16 dragThreshold = -1; // -1 means use the platform default
53 uint8_t grabPermissions : 8;
54 Qt::CursorShape cursorShape : 6;
55 bool enabled : 1;
56 bool active : 1;
57 bool targetExplicitlySet : 1;
58 bool hadKeepMouseGrab : 1; // some handlers override target()->setKeepMouseGrab(); this remembers previous state
59 bool hadKeepTouchGrab : 1; // some handlers override target()->setKeepTouchGrab(); this remembers previous state
60 bool cursorSet : 1;
61 bool cursorDirty : 1;
62};
63
64QT_END_NAMESPACE
65
66#endif // QQUICKPOINTERHANDLER_P_H