Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.11.1
-
None
-
LG G&, LG G2, Samsung A3, Honor 6, Asus ZenPad 10
Description
My app runs completely in landscape mode (android:screenOrientation="landscape").
It runs correctly on my smartphones, but on my tablets the angles (horizon, elevation) of the QRotationssensor delivers values from the portrait mode.
The reason is that the accelerator coordinate axes relates to the default orientation, and this is by smartphones 'portrait' and by tablets 'landscape'. So I have to rotate the coordinate system, otherwise QRotationSensor delivers wrong values if keeping the device in landscape format.
m_pQrs = new QRotationSensor(this); m_pQrs->setAxesOrientationMode(QSensor::UserOrientation); m_pQrs->setUserOrientation(90); qDebug() << "currentOrientation " << m_pQrs->currentOrientation(); // 0 qDebug() << "isFeatureSupported " << m_pQrs->isFeatureSupported(QSensor::AxesOrientation); // false
I tested setAxesOrientationMode() on different smartphones and tablets and unfortunately it works on no devices. So currently it's not possible to use tablets for AR/VR applications with Qt.