Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qpointingdevice_p.h
Go to the documentation of this file.
1// Copyright (C) 2020 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 QPOINTINGDEVICE_P_H
5#define QPOINTINGDEVICE_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 <QtCore/qloggingcategory.h>
19#include <QtGui/private/qevent_p.h>
20#include <QtGui/qpointingdevice.h>
21#include <QtGui/private/qtguiglobal_p.h>
22#include <QtGui/private/qinputdevice_p.h>
23#include <QtCore/private/qflatmap_p.h>
24
26
28
30{
31 Q_DECLARE_PUBLIC(QPointingDevice)
32public:
34 QPointingDevice::PointerType pType, QPointingDevice::Capabilities caps,
35 int maxPoints, int buttonCount,
36 const QString &seatName = QString(),
38 : QInputDevicePrivate(name, id, type, caps, seatName),
39 uniqueId(uniqueId),
40 maximumTouchPoints(qint8(maxPoints)), buttonCount(qint8(buttonCount)),
41 pointerType(pType)
42 {
43 pointingDeviceType = true;
44 activePoints.reserve(maxPoints);
45 }
47
48 void sendTouchCancelEvent(QTouchEvent *cancelEvent);
49
56 QPointer<QObject> exclusiveGrabberContext; // extra info about where the grab happened
58 QList<QPointer <QObject> > passiveGrabbersContext; // parallel list: extra info about where the grabs happened
59 };
60 EventPointData *queryPointById(int id) const;
61 EventPointData *pointById(int id) const;
62 void removePointById(int id);
63 QObject *firstActiveTarget() const;
64 QWindow *firstActiveWindow() const;
65
66 QObject *firstPointExclusiveGrabber() const;
67 void setExclusiveGrabber(const QPointerEvent *event, const QEventPoint &point, QObject *exclusiveGrabber);
68 bool removeExclusiveGrabber(const QPointerEvent *event, const QObject *grabber);
69 bool addPassiveGrabber(const QPointerEvent *event, const QEventPoint &point, QObject *grabber);
70 static bool setPassiveGrabberContext(EventPointData *epd, QObject *grabber, QObject *context);
71 bool removePassiveGrabber(const QPointerEvent *event, const QEventPoint &point, QObject *grabber);
72 void clearPassiveGrabbers(const QPointerEvent *event, const QEventPoint &point);
73 void removeGrabber(QObject *grabber, bool cancel = false);
74
77
79 quint32 toolId = 0; // only for Wacom tablets
80 qint8 maximumTouchPoints = 0;
81 qint8 buttonCount = 0;
83 bool toolProximity = false; // only for Wacom tablets
84
86 {
87 return static_cast<QPointingDevicePrivate *>(QObjectPrivate::get(q));
88 }
89
90 inline static const QPointingDevicePrivate *get(const QPointingDevice *q)
91 {
92 return static_cast<const QPointingDevicePrivate *>(QObjectPrivate::get(q));
93 }
94
95 static const QPointingDevice *tabletDevice(QInputDevice::DeviceType deviceType,
98
99 static const QPointingDevice *queryTabletDevice(QInputDevice::DeviceType deviceType,
102 QInputDevice::Capabilities capabilities = QInputDevice::Capability::None,
103 qint64 systemId = 0);
104
105 static const QPointingDevice *pointingDeviceById(qint64 systemId);
106};
107
109
110#endif // QPOINTINGDEVICE_P_H
The QEventPoint class provides information about a point in a QPointerEvent.
Definition qeventpoint.h:20
DeviceType
This enum represents the type of device that generated a QPointerEvent.
Definition qlist.h:74
static QObjectPrivate * get(QObject *o)
Definition qobject_p.h:153
\inmodule QtCore
Definition qobject.h:90
A base class for pointer events.
Definition qevent.h:73
\inmodule QtCore
Definition qpointer.h:18
~QPointingDevicePrivate() override
QPointingDevicePrivate(const QString &name, qint64 id, QInputDevice::DeviceType type, QPointingDevice::PointerType pType, QPointingDevice::Capabilities caps, int maxPoints, int buttonCount, const QString &seatName=QString(), QPointingDeviceUniqueId uniqueId=QPointingDeviceUniqueId())
static const QPointingDevicePrivate * get(const QPointingDevice *q)
QPointingDeviceUniqueId uniqueId
static QPointingDevicePrivate * get(QPointingDevice *q)
QPointingDeviceUniqueId identifies a unique object, such as a tagged token or stylus,...
The QPointingDevice class describes a device from which mouse, touch or tablet events originate.
PointerType
This enum represents what is interacting with the pointing device.
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:127
The QTouchEvent class contains parameters that describe a touch event.
Definition qevent.h:916
\inmodule QtGui
Definition qwindow.h:63
Combined button and popup list for selecting options.
static void * context
#define Q_DECLARE_LOGGING_CATEGORY(name)
GLenum GLuint id
[7]
GLenum type
GLuint name
struct _cl_event * event
GLdouble GLdouble GLdouble GLdouble q
Definition qopenglext.h:259
unsigned int quint32
Definition qtypes.h:45
long long qint64
Definition qtypes.h:55
QT_BEGIN_NAMESPACE typedef signed char qint8
Definition qtypes.h:40
static QPointingDevice::PointerType pointerType(unsigned currentCursor)
static QInputDevice::DeviceType deviceType(const UINT cursorType)
future cancel()
QList< QPointer< QObject > > passiveGrabbers
QList< QPointer< QObject > > passiveGrabbersContext