Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. How "showMinimized" on Android
Forum Update on Monday, May 27th 2025

How "showMinimized" on Android

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
6 Posts 2 Posters 1.2k Views
  • 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.
  • CharlieGC Offline
    CharlieGC Offline
    CharlieG
    wrote on last edited by
    #1

    Hello,

    I want use showMinimized() function of ApplicationWindow to reduce the application when the user click on button of device to close it.

    The goal is don't to close the application if the user types the wrong button on his phone. (I have to do this to temporarily solve this problem)

    On my PC this correctly works, but not on Android device.

    Do you know how I can do this?

    Tank you in advance.

    Charlie

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      There's no concept like showMinimized on mobile platform. Your application is either active and full-screen or inactive and in the back..

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • CharlieGC Offline
        CharlieGC Offline
        CharlieG
        wrote on last edited by
        #3

        Hi,

        Thank you for your answer. I don't find the way to force inactive state of my app without use myApp.close() our Qt.quit(). Is it possible ?

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          It should go automatically when going in background.

          Do you have specific stuff to do when that happens ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          CharlieGC 1 Reply Last reply
          0
          • SGaistS SGaist

            It should go automatically when going in background.

            Do you have specific stuff to do when that happens ?

            CharlieGC Offline
            CharlieGC Offline
            CharlieG
            wrote on last edited by
            #5

            @SGaist

            Not exactly...

            I am currently working on a application for PC and Android using WebView. With Android, I meet problems of safeguarding the collected informations (login, password, configuration, ...).

            For now the only simple way I found to solve this problem is to block the closure of the program, especially when the user clicks the back button on the phone (the Qt.Key_Back). Currently I am therefore well:

            ApplicationWindow {
                // ....
            
                onClosing: {
                    close.accepted = false
                }
            
                // ....
            }
            

            Now I want to do the same action with the button when the user presses the center button of the phone (a Samsung S6 for example) :

            ApplicationWindow {
                // ....
            
                // Either by
                onClosing: {
                    close.accepted = false
                    // do something ...
                }
            
                // Either by
                FocusScope {
                    id: focusScope
                    focus: true
                    anchors.fill: parent
                    Keys.onReleased: {
                        if(event.key === Qt.Key_Back) {
                            // do something ...
                        }
                     }
                    // ....
                }
            
                // Either by ????
            }
            

            Have you an idea ?

            Good night & Thank you very much.

            Charlie

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              I'd suggest asking on the interest mailing list about that session data saving problem. You'll find there Qt's developers/maintainers. This forum is more user oriented.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              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