Nominate our 2022 Qt Champions!

QML not evaluating signals when Android screen off

  • Hello, I am binding a property defined in C++ to a property in QML. When the screen of the Android device is turned off or the app is put into background the signals comming from the C++-object will no longer be evaluated. Once the app in open again the backlogged signals are evaluated and the QML application continues working.

    Is it possible to have signals work in QML while the app is in the background or the Android device is turned off? It is working for the C++ part of the application. I am using Qt Quick 2 and load my C++ classes with qmlRegisterType into QML.

  • Hi! On Android, applications are paused when they're in the background. This is to save power. Applications that run code in the background are called "Android services", see Android Services.

  • Thanks for your reply! My problem is that the C++ part of the application is still running and actively sending signals to QML. (constant stream of data received with TCP). The signals send from C++ are accumulated and create a huge backlog when the application is resumed, sometimes causing it to crash. Can i somehow disable all signals when the application is in the background?

Log in to reply