Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. [SOLVED] QML on Android : How can I determine the status of my app
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] QML on Android : How can I determine the status of my app

Scheduled Pinned Locked Moved Mobile and Embedded
6 Posts 2 Posters 2.4k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    laithbasildotnetgmail.com
    wrote on last edited by
    #1

    Hi,
    in android app, each activity has many status like onStart , onStop, onPause...etc

    how can I achieve the same thing in Qt specially QML!

    Regards.

    1 Reply Last reply
    1
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      @
      Component.onCompleted: doSomething()

      Component.onDestruction: doSomethingElse()
      @

      (Z(:^

      1 Reply Last reply
      0
      • L Offline
        L Offline
        laithbasildotnetgmail.com
        wrote on last edited by
        #3

        I know about them, but they only when the component creation completed and destructed,

        what I need, is to catch the event when the app goes on background in android phone !

        mainly because I use Audio element in QML and when the app goes in background the music still playing for at least 30 sec before it stops. I want to catch this event to stop the music

        1 Reply Last reply
        0
        • sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          OK. There are some hints about a solution here: "link":http://grokbase.com/t/gg/android-qt/142fzvabb4/detect-when-application-hidden-stopped-paused. And, possibly, "here":http://stackoverflow.com/questions/14147304/how-to-detect-that-my-application-lost-focus-in-qt.

          (Z(:^

          1 Reply Last reply
          0
          • L Offline
            L Offline
            laithbasildotnetgmail.com
            wrote on last edited by
            #5

            Thank you I appreciate your help, I found solution from inside QML without the need to write any more code, its using Qt.application.state which I can determine the application state.

            1 Reply Last reply
            2
            • sierdzioS Offline
              sierdzioS Offline
              sierdzio
              Moderators
              wrote on last edited by
              #6

              Great, that is much better than what I have found :-)

              (Z(:^

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved