Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qinputdevice_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 QINPUTDEVICE_P_H
5#define QINPUTDEVICE_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 <QtGui/private/qtguiglobal_p.h>
19#include <QtGui/qinputdevice.h>
20#include "private/qobject_p.h"
21
23
24class Q_GUI_EXPORT QInputDevicePrivate : public QObjectPrivate
25{
26 Q_DECLARE_PUBLIC(QInputDevice)
27public:
29 QInputDevice::Capabilities caps = QInputDevice::Capability::None,
30 const QString &seatName = QString())
31 : name(name), seatName(seatName), systemId(winSysId), capabilities(caps),
33 {
34 // if the platform doesn't provide device IDs, make one up,
35 // but try to avoid clashing with OS-provided 32-bit IDs
36 static qint64 nextId = qint64(1) << 33;
37 if (!systemId)
38 systemId = nextId++;
39 }
41
46 void *qqExtra = nullptr; // Qt Quick can store arbitrary device-specific data here
47 qint64 systemId = 0;
48 QInputDevice::Capabilities capabilities = QInputDevice::Capability::None;
50 bool pointingDeviceType = false;
51
52 static void registerDevice(const QInputDevice *dev);
53 static void unregisterDevice(const QInputDevice *dev);
54 static bool isRegistered(const QInputDevice *dev);
55 static const QInputDevice *fromId(qint64 systemId);
56
58 {
59 if (a == availableVirtualGeometry)
60 return;
61
62 availableVirtualGeometry = a;
64 Q_Q(QInputDevice);
65 Q_EMIT q->availableVirtualGeometryChanged(availableVirtualGeometry);
66 }
67
69 {
70 return static_cast<QInputDevicePrivate *>(QObjectPrivate::get(q));
71 }
72
73 inline static const QInputDevicePrivate *get(const QInputDevice *q)
74 {
75 return static_cast<const QInputDevicePrivate *>(QObjectPrivate::get(q));
76 }
77};
78
80
81#endif // QINPUTDEVICE_P_H
static const QInputDevicePrivate * get(const QInputDevice *q)
~QInputDevicePrivate() override
static QInputDevicePrivate * get(QInputDevice *q)
QInputDevicePrivate(const QString &name, qint64 winSysId, QInputDevice::DeviceType type, QInputDevice::Capabilities caps=QInputDevice::Capability::None, const QString &seatName=QString())
void setAvailableVirtualGeometry(QRect a)
The QInputDevice class describes a device from which a QInputEvent originates.
DeviceType
This enum represents the type of device that generated a QPointerEvent.
static QObjectPrivate * get(QObject *o)
Definition qobject_p.h:150
\inmodule QtCore\reentrant
Definition qrect.h:30
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
Combined button and popup list for selecting options.
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum type
GLuint name
GLdouble GLdouble GLdouble GLdouble q
Definition qopenglext.h:259
#define Q_EMIT
long long qint64
Definition qtypes.h:60
static uint nextId
static QInputDevice::DeviceType deviceType(const UINT cursorType)