-
Bug
-
Resolution: Invalid
-
P1: Critical
-
None
-
5.7.0
-
None
I am upgrading from Qt 5.5 to 5.7 for Android. I have a project which ran perfectly in 5.1 through 5.5. I skipped 5.6 so I don't know if the problem was introduced there or in 5.7.
This project has the same basic structure as the Qt Notifier example : http://doc.qt.io/qt-5/qtandroidextras-notification-example.html
There is a native droid interface using an extension to class org.qtproject.qt5.android.bindings.QtActivity. It makes bi directional calls across the C++ and Java threads.
It appears that the main QApplication thread on the C++ side (created in function main()), is not running in the background. It does not catch signals emitted from other threads (e.g. Java side calls into C++), QTimers started from it do not run, and it is not possible to use classes such as QUdpSocket which are attached to objects on the main thread. I can't move objects which are QWidgets to other threads (which have such children).
To test this further, I started a QTimer, with a 0 delay, from the construction of an object on the main thread (which is persisting), to make it fire continuously when there are no other events to process. It executes once, proving that it is connected properly, but then never again. It's like the C++ main thread just goes to sleep after running once.
If I output all the threads seen from within the native Android code, I can see two named "Qt Thread". They are in state "RUNNABLE", indicating they ought to be executing.
What changed? What is the solution? I can't move forward with 5.7 without fixing this. This is a large project that runs on Windows, Mac, iOS, and Android, and works in many previous versions of Qt. A dramatic overhaul is not an option for me.