summaryrefslogtreecommitdiffstats
path: root/src/sensors/qsensor.h
diff options
context:
space:
mode:
authorThomas McGuire <thomas.mcguire.qnx@kdab.com>2013-01-29 15:01:40 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-02-08 11:18:01 +0100
commit4d9edb754b3dff3331c8d8790a04548f0981f315 (patch)
treec5d96c9f8136c16b05323fb4e0841201af1c4ea4 /src/sensors/qsensor.h
parent62ce0b92ee34a1ae6b2f4e81bb0efbaa2a7d53c9 (diff)
Use real properties for QSensor::bufferSize & co
The #ifdef Q_DOC hack is not really needed and was confusing. In addition, expose those properties to the QML API. As a result, the backends can now listen to the bufferSizeChanged() signal to update the buffering while the sensor is running. This has been implemented for the BlackBerry platform. Change-Id: I5239ba2a4b791cfc9f684b44ff2bc103a7b5b0da Reviewed-by: Lorn Potter <lorn.potter@jollamobile.com>
Diffstat (limited to 'src/sensors/qsensor.h')
-rw-r--r--src/sensors/qsensor.h20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/sensors/qsensor.h b/src/sensors/qsensor.h
index 5c47df3b..2314fb94 100644
--- a/src/sensors/qsensor.h
+++ b/src/sensors/qsensor.h
@@ -95,11 +95,9 @@ class Q_SENSORS_EXPORT QSensor : public QObject
Q_PROPERTY(AxesOrientationMode axesOrientationMode READ axesOrientationMode WRITE setAxesOrientationMode NOTIFY axesOrientationModeChanged)
Q_PROPERTY(int currentOrientation READ currentOrientation NOTIFY currentOrientationChanged)
Q_PROPERTY(int userOrientation READ userOrientation WRITE setUserOrientation NOTIFY userOrientationChanged)
-#ifdef Q_QDOC
- Q_PROPERTY(int maxBufferSize)
- Q_PROPERTY(int efficientBufferSize)
- Q_PROPERTY(int bufferSize)
-#endif
+ Q_PROPERTY(int maxBufferSize READ maxBufferSize NOTIFY maxBufferSizeChanged)
+ Q_PROPERTY(int efficientBufferSize READ efficientBufferSize NOTIFY efficientBufferSizeChanged)
+ Q_PROPERTY(int bufferSize READ bufferSize WRITE setBufferSize NOTIFY bufferSizeChanged)
public:
enum Feature {
Buffering,
@@ -177,6 +175,15 @@ public:
int userOrientation() const;
void setUserOrientation(int userOrientation);
+ int maxBufferSize() const;
+ void setMaxBufferSize(int maxBufferSize);
+
+ int efficientBufferSize() const;
+ void setEfficientBufferSize(int efficientBufferSize);
+
+ int bufferSize() const;
+ void setBufferSize(int bufferSize);
+
public Q_SLOTS:
// Start receiving values from the sensor
bool start();
@@ -196,6 +203,9 @@ Q_SIGNALS:
void axesOrientationModeChanged(AxesOrientationMode axesOrientationMode);
void currentOrientationChanged(int currentOrientation);
void userOrientationChanged(int userOrientation);
+ void maxBufferSizeChanged(int maxBufferSize);
+ void efficientBufferSizeChanged(int efficientBufferSize);
+ void bufferSizeChanged(int bufferSize);
protected:
explicit QSensor(const QByteArray &type, QSensorPrivate &dd, QObject* parent = 0);