Important: Please read the Qt Code of Conduct -

[android] QML Window.visibility property not working in Qt 5.3 (SOLVED)

  • Hello!

    I have a game written in QML that utilizes QtMultimedia's Audio object to play some background music. I want to able to determine when the user leaves the Android activity, so that I can pause the music and the game itself. As things are currently, if I go back to the homescreen the app keeps playing music and all the QML timers still run, even if I lock the device! Oddly, it seems that the activity is still trying to render to the surface, because the moment I minimize the app, EGL_BAD_SURFACE errors abound the Application Output pane in QtCreator.

    I was trying to use the Window.visibility property to determine if the app is being displayed currently but this fails, it never changes to Hidden or Minimized. Is there is any other way to detect if the application is not on screen on Android?

    Thanks in advance

Log in to reply