summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@digia.com>2013-07-22 09:20:44 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-07-22 10:07:38 +0200
commit29fda24ca8abdf7179139f1f7f74f9147edddfac (patch)
treea98993031cef08348c1619285eff73f4925d8f04 /src/gui/kernel
parent16579e5b84ee3bc42b838e02b40f0b3f3262f2fb (diff)
added maximumTouchPoints to QTouchDevice
This was missing information which the driver can provide. Change-Id: I2574745635d6fdf608bc5617999aec46d9312c09 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Diffstat (limited to 'src/gui/kernel')
-rw-r--r--src/gui/kernel/qtouchdevice.cpp19
-rw-r--r--src/gui/kernel/qtouchdevice.h2
-rw-r--r--src/gui/kernel/qtouchdevice_p.h4
3 files changed, 24 insertions, 1 deletions
diff --git a/src/gui/kernel/qtouchdevice.cpp b/src/gui/kernel/qtouchdevice.cpp
index 02c6dd9efc..3ad4b4161e 100644
--- a/src/gui/kernel/qtouchdevice.cpp
+++ b/src/gui/kernel/qtouchdevice.cpp
@@ -140,6 +140,16 @@ QTouchDevice::Capabilities QTouchDevice::capabilities() const
}
/*!
+ Returns the maximum number of simultaneous touch points (fingers) that
+ can be detected.
+ \since 5.2
+ */
+int QTouchDevice::maximumTouchPoints() const
+{
+ return d->maxTouchPoints;
+}
+
+/*!
Returns the touch device name.
This string may often be empty. It is however useful for systems that have
@@ -169,6 +179,15 @@ void QTouchDevice::setCapabilities(Capabilities caps)
}
/*!
+ Sets the maximum number of simultaneous touchpoints \a max
+ supported by the device and its driver.
+ */
+void QTouchDevice::setMaximumTouchPoints(int max)
+{
+ d->maxTouchPoints = max;
+}
+
+/*!
Sets the \a name (a unique identifier) for the device. In most systems it is
enough to leave this unset and keep the default empty name. This identifier
becomes important when having multiple touch devices and a need to
diff --git a/src/gui/kernel/qtouchdevice.h b/src/gui/kernel/qtouchdevice.h
index 312bdce3e6..6aca93907c 100644
--- a/src/gui/kernel/qtouchdevice.h
+++ b/src/gui/kernel/qtouchdevice.h
@@ -75,10 +75,12 @@ public:
QString name() const;
DeviceType type() const;
Capabilities capabilities() const;
+ int maximumTouchPoints() const;
void setName(const QString &name);
void setType(DeviceType devType);
void setCapabilities(Capabilities caps);
+ void setMaximumTouchPoints(int max);
private:
QTouchDevicePrivate *d;
diff --git a/src/gui/kernel/qtouchdevice_p.h b/src/gui/kernel/qtouchdevice_p.h
index 435f8a5c37..fb87f49736 100644
--- a/src/gui/kernel/qtouchdevice_p.h
+++ b/src/gui/kernel/qtouchdevice_p.h
@@ -64,12 +64,14 @@ class QTouchDevicePrivate
public:
QTouchDevicePrivate()
: type(QTouchDevice::TouchScreen),
- caps(QTouchDevice::Position)
+ caps(QTouchDevice::Position),
+ maxTouchPoints(1)
{ }
QTouchDevice::DeviceType type;
QTouchDevice::Capabilities caps;
QString name;
+ int maxTouchPoints;
static void registerDevice(QTouchDevice *dev);
static bool isRegistered(QTouchDevice *dev);