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 do I show a hidden window?
Forum Update on Monday, May 27th 2025

How do I show a hidden window?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
21 Posts 5 Posters 2.5k 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.
  • M Mikeeeeee
    4 Aug 2020, 07:10

    In desktop, the app is first expanded, then I hidden it by pressing the hidde button, in Android, it is hidden by pressing the center button.

    J Offline
    J Offline
    jsulm
    Lifetime Qt Champion
    wrote on 4 Aug 2020, 07:15 last edited by
    #4

    @Mikeeeeee https://stackoverflow.com/questions/7817334/qt-correct-way-to-show-display-raise-window

    https://forum.qt.io/topic/113070/qt-code-of-conduct

    1 Reply Last reply
    1
    • M Offline
      M Offline
      Mikeeeeee
      wrote on 4 Aug 2020, 11:33 last edited by
      #5

      But this is all for widgets. How do I do this for QML?

      J 1 Reply Last reply 4 Aug 2020, 12:33
      0
      • M Mikeeeeee
        4 Aug 2020, 11:33

        But this is all for widgets. How do I do this for QML?

        J Offline
        J Offline
        jsulm
        Lifetime Qt Champion
        wrote on 4 Aug 2020, 12:33 last edited by
        #6

        @Mikeeeeee What about https://doc.qt.io/qt-5/qml-qtquick-window-window.html#raise-method ?

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • M Offline
          M Offline
          Mikeeeeee
          wrote on 4 Aug 2020, 13:31 last edited by
          #7

          It is wirk in Windows

                      show()
                      raise()
          

          But what me need doing in Android?

          1 Reply Last reply
          0
          • G Offline
            G Offline
            GrecKo
            Qt Champions 2018
            wrote on 4 Aug 2020, 13:38 last edited by
            #8

            You can't do that on Android

            1 Reply Last reply
            0
            • M Offline
              M Offline
              Mikeeeeee
              wrote on 4 Aug 2020, 13:54 last edited by
              #9

              But the alarm clock works on Android. So I can do it. But how? When collapsing the app stops, how do I make it work collapsed?

              1 Reply Last reply
              0
              • M Offline
                M Offline
                Mikeeeeee
                wrote on 4 Aug 2020, 16:40 last edited by
                #10

                Maybe its can help?

                J 1 Reply Last reply 5 Aug 2020, 04:54
                0
                • M Mikeeeeee
                  4 Aug 2020, 16:40

                  Maybe its can help?

                  J Offline
                  J Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on 5 Aug 2020, 04:54 last edited by
                  #11

                  @Mikeeeeee Yes, you have to use services if you want to run something in background on iOS/Android.

                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  2
                  • M Offline
                    M Offline
                    Mikeeeeee
                    wrote on 7 Aug 2020, 07:57 last edited by
                    #12

                    There is no "android:process"in my Manifest. Where should I specify "android:process"? Are there any examples?

                    1 Reply Last reply
                    0
                    • M Offline
                      M Offline
                      Mikeeeeee
                      wrote on 7 Aug 2020, 08:15 last edited by Mikeeeeee 8 Jul 2020, 08:19
                      #13

                      I do this in Manifest

                          <service
                                  android:exported="false"
                                  android:enabled="true"
                                  android:name=".MyService"
                                  android:process=".MyService">
                          </service>
                      

                      Me need inclute QTimer or class in MyService. How can I do this?
                      May be somewhere me need use this?

                      startService(getApplicationContext(), MyService.class);
                      
                      J 1 Reply Last reply 7 Aug 2020, 08:27
                      0
                      • M Mikeeeeee
                        7 Aug 2020, 08:15

                        I do this in Manifest

                            <service
                                    android:exported="false"
                                    android:enabled="true"
                                    android:name=".MyService"
                                    android:process=".MyService">
                            </service>
                        

                        Me need inclute QTimer or class in MyService. How can I do this?
                        May be somewhere me need use this?

                        startService(getApplicationContext(), MyService.class);
                        
                        J Offline
                        J Offline
                        jsulm
                        Lifetime Qt Champion
                        wrote on 7 Aug 2020, 08:27 last edited by
                        #14

                        @Mikeeeeee I suggest you first read this: https://doc.qt.io/qt-5/android-services.html

                        "Me need inclute QTimer or class in MyService. How can I do this?" - like always maybe? Include QTimer header and use it...

                        https://forum.qt.io/topic/113070/qt-code-of-conduct

                        1 Reply Last reply
                        2
                        • M Offline
                          M Offline
                          Mikeeeeee
                          wrote on 7 Aug 2020, 10:56 last edited by
                          #15

                          The documentation shows a lot of code parts, but it is not clear where they should be in the code. Can I view the entire sample project?

                          P 1 Reply Last reply 7 Aug 2020, 12:02
                          0
                          • M Mikeeeeee
                            7 Aug 2020, 10:56

                            The documentation shows a lot of code parts, but it is not clear where they should be in the code. Can I view the entire sample project?

                            P Offline
                            P Offline
                            Pablo J. Rogina
                            wrote on 7 Aug 2020, 12:02 last edited by
                            #16

                            @Mikeeeeee said in How do I show a hidden window?:

                            The documentation shows a lot of code

                            you may want to look at this article about "How to create an Android service using Qt"

                            Upvote the answer(s) that helped you solve the issue
                            Use "Topic Tools" button to mark your post as Solved
                            Add screenshots via postimage.org
                            Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

                            M 1 Reply Last reply 7 Aug 2020, 12:12
                            3
                            • P Pablo J. Rogina
                              7 Aug 2020, 12:02

                              @Mikeeeeee said in How do I show a hidden window?:

                              The documentation shows a lot of code

                              you may want to look at this article about "How to create an Android service using Qt"

                              M Offline
                              M Offline
                              Mikeeeeee
                              wrote on 7 Aug 2020, 12:12 last edited by
                              #17

                              @Pablo-J-Rogina Thanks. Q do you know where to get a project with sample code?

                              P 1 Reply Last reply 7 Aug 2020, 12:16
                              0
                              • M Mikeeeeee
                                7 Aug 2020, 12:12

                                @Pablo-J-Rogina Thanks. Q do you know where to get a project with sample code?

                                P Offline
                                P Offline
                                Pablo J. Rogina
                                wrote on 7 Aug 2020, 12:16 last edited by
                                #18

                                @Mikeeeeee said in How do I show a hidden window?:

                                do you know where to get a project with sample code?

                                Your reply shows that you didn't even bother to have a look at the article I linked to...

                                Upvote the answer(s) that helped you solve the issue
                                Use "Topic Tools" button to mark your post as Solved
                                Add screenshots via postimage.org
                                Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

                                1 Reply Last reply
                                2
                                • M Offline
                                  M Offline
                                  Mikeeeeee
                                  wrote on 7 Aug 2020, 12:47 last edited by
                                  #19

                                  I looked at the article and looked at the code on the git, but everything is not very clear. It is unclear why the server is needed. And whether this code is enough to start the service or whether you need something else. And if I run it, my app will also work in hide mode?

                                  // java file android/src/com/kdab/training/MyService.java
                                  package com.kdab.training;
                                  
                                  import android.content.Context;
                                  import android.content.Intent;
                                  import org.qtproject.qt5.android.bindings.QtService;
                                  
                                  public class MyService extends QtService
                                  {
                                      public static void startMyService(Context ctx) {
                                          ctx.startService(new Intent(ctx, MyService.class));
                                      }
                                  }
                                  
                                  1 Reply Last reply
                                  0
                                  • M Offline
                                    M Offline
                                    Mikeeeeee
                                    wrote on 7 Aug 2020, 13:31 last edited by Mikeeeeee 8 Jul 2020, 13:53
                                    #20

                                    if i to do this, then the code is not compiled

                                    <application ...
                                    public class MyBroadcastReceiver extends BroadcastReceiver {
                                        
                                            @Override
                                        
                                            public void onReceive(Context context, Intent intent) {
                                        
                                                Intent startServiceIntent = new Intent(context, MyService.class);
                                        
                                                context.startService(startServiceIntent);
                                        
                                            }
                                        
                                        }
                                    1 Reply Last reply
                                    0
                                    • M Offline
                                      M Offline
                                      Mikeeeeee
                                      wrote on 10 Aug 2020, 08:02 last edited by
                                      #21

                                      Is there a simple and working example of using Android services?

                                      1 Reply Last reply
                                      0

                                      13/21

                                      7 Aug 2020, 08:15

                                      • Login

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