summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qinputdevice.h
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2020-06-08 18:42:22 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2020-07-06 10:09:02 +0000
commit546e44d473d6fece9a8996415456ac494ea3a046 (patch)
tree58381f7306665fa16ad49b6a7240b1c744eb3c57 /src/gui/kernel/qinputdevice.h
parent8dd6957cd7a1d86714b32b97dffe603a8636848a (diff)
Add QInputDevice::availableVirtualGeometry()
This property tells what part of the virtual desktop the input device can access. This is not a one-to-one mapping with a QScreen, because a Wacom tablet might be configured to access a whole desktop, a whole screen, or an area corresponding to the drawing area of one window; a mouse normally can access the whole desktop (so QScreen::virtualGeometry() would be identical to QInputDevice::availableVirtualGeometry()); a touchscreen normally is mapped to one screen but could be mapped differently; etc. It's possible to find the intersection of the rectangular area with the screen(s) that it overlaps, though. Task-number: QTBUG-78839 Change-Id: I9040e20fb5a3dec8a9a0dd827735826c4c1eea38 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Diffstat (limited to 'src/gui/kernel/qinputdevice.h')
-rw-r--r--src/gui/kernel/qinputdevice.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gui/kernel/qinputdevice.h b/src/gui/kernel/qinputdevice.h
index 5bff29f897..aa6b3aaf7c 100644
--- a/src/gui/kernel/qinputdevice.h
+++ b/src/gui/kernel/qinputdevice.h
@@ -58,6 +58,7 @@ class Q_GUI_EXPORT QInputDevice : public QObject
Q_PROPERTY(Capabilities capabilities READ capabilities CONSTANT)
Q_PROPERTY(qint64 id READ id CONSTANT)
Q_PROPERTY(QString seatName READ seatName CONSTANT)
+ Q_PROPERTY(QRect availableVirtualGeometry READ availableVirtualGeometry NOTIFY availableVirtualGeometryChanged)
public:
enum class DeviceType : qint16 {
@@ -106,12 +107,16 @@ public:
bool hasCapability(Capability cap) const;
qint64 id() const;
QString seatName() const;
+ QRect availableVirtualGeometry() const;
static QList<const QInputDevice *> devices();
static const QInputDevice *primaryKeyboard(const QString& seatName = QString());
bool operator==(const QInputDevice &other) const;
+Q_SIGNALS:
+ void availableVirtualGeometryChanged(QRect area);
+
protected:
QInputDevice(QInputDevicePrivate &d, QObject *parent = nullptr);