Solved RotationSensor busted in Qt 5.13?
-
I recently upgraded my Android app from Qt 5.12 to 5.13. The QRotationSensor is now giving incorrect readings. It is consistently wrong in both range and values. Confirmed on two devices. I use the sensor to detect when the phone is turned over, so my app is completely broken now. Has anybody else experienced this?
-
Hi @tom_h,
The changelog states:
- Rewrite Qt Android Sensors using NDK API.
- Raise minimal Android sdk version to v21
So it is possible, that something really broke.
Have you already checked bugreports.qt.io ?
If you find nothing, consider creating a bug report with a minimal example and the affected devices, android versions, etc. - and please post a link to the report here.
Thanks!
-
Yes, I see a change. The values seem to be offset by 90 degrees.
-
Update: the regression happened between 5.12.3 and 5.12.4. So it works in 5.12.3 but now something else is broken. I use a QPropertyAnimation to animate a 3D model when the phone is turned over. Now that animation speeds up after awhile for no apparent reason. It should take 2 seconds but finishes in less than 1.
My app was written in Qt 5.12.1 for armv7 (32 bit). I upgraded Qt to make an armv8 (64 bit) version, because there was no arm64 option in Qt 5.12.1. Nothing changed in my app. If there's a way to make an arm64 app with Qt 5.12.1, please let me know. Otherwise I'm screwed because Google now requires a 64 bit version as of August 1.
I filed a bug report here: https://bugreports.qt.io/browse/QTBUG-77628
-
@tom_h said in RotationSensor busted in Qt 5.13?:
My app was written in Qt 5.12.1 for armv7 (32 bit). I upgraded Qt to make an armv8 (64 bit) version, because there was no arm64 option in Qt 5.12.1. Nothing changed in my app. If there's a way to make an arm64 app with Qt 5.12.1
you could potentially build 5.12.1 for armv8 yourself. A matter of pointing the configure script to the correct compiler.
You can take a look at this wiki article, it should contain everything you need
https://wiki.qt.io/Android#Building_Qt -
@j-hilk Thank you. I found 5.12.1 in the download archives and it does indeed include arm64. The reason I thought it didn't was because I originally developed my app on Windows and at the time I installed Qt there wasn't an arm64 kit. I just checked -- arm64 doesn't show up in the MaintenenceTool, but does show up in a re-install of 5.12.1 for Windows.
However, that didn't fix my QPropertyAnimation problem, so I have to conclude I must have changed something. So please ignore that part of my post. The QRotationSensor part still applies.
-
I was able to build the arm64 version with Qt 5.12.1 and it works again. My bug report was a duplicate. Here's the one to watch:
-
Thanks for the feedback !