summaryrefslogtreecommitdiffstats
path: root/src/sensors/qtapsensor.cpp
diff options
context:
space:
mode:
authorThomas McGuire <thomas.mcguire.qnx@kdab.com>2013-02-01 10:10:43 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-02-08 11:17:43 +0100
commita3f4766964022ff0dc7ea0832922c2a58ab47e82 (patch)
treea67921991d305274ac3e9c9d238de63fb19bf52e /src/sensors/qtapsensor.cpp
parentb974efa5ca4306b1b9474207317ade4da33bdbc9 (diff)
Convert QTapSensor::returnDoubleTapEvents to a proper property
Change-Id: I62f626a8df765a50815f3b275da8b858cb24a30d Reviewed-by: Lorn Potter <lorn.potter@jollamobile.com>
Diffstat (limited to 'src/sensors/qtapsensor.cpp')
-rw-r--r--src/sensors/qtapsensor.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/sensors/qtapsensor.cpp b/src/sensors/qtapsensor.cpp
index bd65196b..23ec492f 100644
--- a/src/sensors/qtapsensor.cpp
+++ b/src/sensors/qtapsensor.cpp
@@ -211,7 +211,7 @@ char const * const QTapSensor::type("QTapSensor");
Construct the sensor as a child of \a parent.
*/
QTapSensor::QTapSensor(QObject *parent)
- : QSensor(QTapSensor::type, parent)
+ : QSensor(QTapSensor::type, *new QTapSensorPrivate, parent)
{
}
@@ -240,10 +240,24 @@ QTapSensor::~QTapSensor()
It is not possible to have the sensor report both single and double tap events.
If both are needed the app should create 2 sensor objects.
- Note that you must access this property via QObject::property() and QObject::setProperty().
The property must be set before calling start().
*/
+bool QTapSensor::returnDoubleTapEvents() const
+{
+ Q_D(const QTapSensor);
+ return d->returnDoubleTapEvents;
+}
+
+void QTapSensor::setReturnDoubleTapEvents(bool returnDoubleTapEvents)
+{
+ Q_D(QTapSensor);
+ if (d->returnDoubleTapEvents != returnDoubleTapEvents) {
+ d->returnDoubleTapEvents = returnDoubleTapEvents;
+ emit returnDoubleTapEventsChanged(returnDoubleTapEvents);
+ }
+}
+
#include "moc_qtapsensor.cpp"
QT_END_NAMESPACE