#include <QtSensors/QOrientableSensorBase>

More information will be added here shortly. For now, you'll find more extensive information about this class in the Qt reference for QOrientableSensorBase


The QOrientableSensorBase class is the base class for all sensors that react to screen orientation changes.

All sensors based on this class support changing the reporting of the reading values based on the orientation of the screen. This is controlled by the axesOrientationMode property, which controls how the orientation affects the reading values.

In the default mode, QOrientableSensorBase::FixedOrientation, the reading values remain unaffected by the orientation. In the QOrientableSensorBase::AutomaticOrientation mode, the reading values are automatically rotated by taking the current screen orientation into account. And finally, in the QOrientableSensorBase::UserOrientation mode, the reading values are rotated according to a user-specified orientation.

The functionality of this is only available if it is supported by the backend, which can be checked by calling QSensor::isFeatureSupported() with the QSensor::AxesOrientation flag.

The orientation here is always the screen orientation, not the device orientation. The orientation values range from 0 to 270 degrees. The orientation is applied in clockwise direction. Note that when rotating a device by 90 degrees counter-clockwise, the screen orientation compensates for that by rotating 90 degrees to the right.


Last modified: 2015-03-26

Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus