summaryrefslogtreecommitdiffstats
path: root/src/sensors/qsensorbackend.cpp
diff options
context:
space:
mode:
authorThomas McGuire <thomas.mcguire.qnx@kdab.com>2012-07-09 10:54:25 +0200
committerQt by Nokia <qt-info@nokia.com>2012-07-23 00:18:31 +0200
commit505dbc8230414a31cd3def9f2d8b144b0e9444f4 (patch)
treeefaeb8654cab5e748ab94111ab8c560cf6a55b00 /src/sensors/qsensorbackend.cpp
parent10218b43c4fa89aad8336bc7f35163723c05304b (diff)
Add QSensor::isFeatureSupported()
Now it is possible to check if a backend supports a specific feature. During reviews of features like acceleration mode or duplicate skipping, the issue was raised how to check if these features are actually supported. The same is true for existing features like QMagnetometer::returnGeoValues. Change-Id: I47115d6c487bbcbb668a9021cdc7085e6780a67c Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Lorn Potter <lorn.potter@nokia.com>
Diffstat (limited to 'src/sensors/qsensorbackend.cpp')
-rw-r--r--src/sensors/qsensorbackend.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/sensors/qsensorbackend.cpp b/src/sensors/qsensorbackend.cpp
index 7c65c59b..d0a5b5c1 100644
--- a/src/sensors/qsensorbackend.cpp
+++ b/src/sensors/qsensorbackend.cpp
@@ -72,6 +72,21 @@ QSensorBackend::~QSensorBackend()
}
/*!
+ Checks whether a feature is supported by this sensor backend.
+
+ This is the backend side of QSensor::isFeatureSupported(). Reimplement this function if the
+ backend supports one of the additional sensor features of QSensor::Feature.
+
+ \return whether the feature \a feature is supported by this backend. The default implementation returns false.
+ \since 5.0
+ */
+bool QSensorBackend::isFeatureSupported(QSensor::Feature feature) const
+{
+ Q_UNUSED(feature);
+ return false;
+}
+
+/*!
Notify the QSensor class that a new reading is available.
*/
void QSensorBackend::newReadingAvailable()