diff options
author | Kevin Ottens <kevin.ottens.qnx@kdab.com> | 2012-05-24 11:38:43 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-06-19 02:26:25 +0200 |
commit | a42fd9d05a8f8db8a79fc8da920fa917188b8e9b (patch) | |
tree | 6a048369935054a6913b84f73fa394b5d11f2e83 /src/plugins/sensors/blackberry/bbrotationsensor.h | |
parent | 440bc188c8f0f427ef979b8e9cff8d39fdaa8af7 (diff) |
BlackBerry backend: Automatic Axis Remapping
Add a backend specific property named "automaticAxisRemapping" to force
the sensor to modify its coordinate system based on the device native
orientation.
So usable from C++ using 'setProperty("automaticAxisRemapping", true)'
or from QML using 'property var automaticAxisRemapping: true'.
Note it requires QPlatformScreen::nativeOrientation() private API to
find out the device native orientation.
Change-Id: If4c5622fd42c74a55fe6d36966d7f589e612c117
Reviewed-by: Adam Parco <aparco@rim.com>
Reviewed-by: Lincoln Ramsay <lincoln.ramsay@nokia.com>
Diffstat (limited to 'src/plugins/sensors/blackberry/bbrotationsensor.h')
-rw-r--r-- | src/plugins/sensors/blackberry/bbrotationsensor.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/plugins/sensors/blackberry/bbrotationsensor.h b/src/plugins/sensors/blackberry/bbrotationsensor.h index 475ad223..d2fd8a05 100644 --- a/src/plugins/sensors/blackberry/bbrotationsensor.h +++ b/src/plugins/sensors/blackberry/bbrotationsensor.h @@ -58,7 +58,16 @@ protected: bool addDefaultRange(); qreal convertValue(float bbValue); bool updateReadingFromEvent(const sensor_event_t &event, QRotationReading *reading); + bool isAutoAxisRemappingEnabled() const; + bool eventFilter(QObject *object, QEvent *event); + +private: + void updateOrientation(); + + Qt::ScreenOrientation m_orientation; + Qt::ScreenOrientation m_nativeOrientation; + float m_mappingMatrix[4]; }; #endif |