From 505dbc8230414a31cd3def9f2d8b144b0e9444f4 Mon Sep 17 00:00:00 2001 From: Thomas McGuire Date: Mon, 9 Jul 2012 10:54:25 +0200 Subject: 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 Reviewed-by: Lorn Potter --- src/sensors/qsensorbackend.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/sensors/qsensorbackend.cpp') 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 @@ -71,6 +71,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. */ -- cgit v1.2.3