Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to access qwindow while debugging
Forum Updated to NodeBB v4.3 + New Features

How to access qwindow while debugging

Scheduled Pinned Locked Moved Unsolved General and Desktop
8 Posts 2 Posters 1.4k 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 Offline
    M Offline
    MasterBlade
    wrote on last edited by
    #1

    Hello, I was trying to debug on my program. But I couldn't focus on the windows qt created. When I clicked that window, it just flashed and minimized in less than 1 sec. I also noticed that the window wasn't updating, still in its original form.

    I tried to use show(); instead of exec(); but it wouldn't help.

    What should I do?

    jsulmJ 1 Reply Last reply
    0
    • M MasterBlade

      Hello, I was trying to debug on my program. But I couldn't focus on the windows qt created. When I clicked that window, it just flashed and minimized in less than 1 sec. I also noticed that the window wasn't updating, still in its original form.

      I tried to use show(); instead of exec(); but it wouldn't help.

      What should I do?

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @MasterBlade Can you provide more information? Do you use break points? I mean, does your app stop at a break point? Does your app work properly if you don't debug it?

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

      M 1 Reply Last reply
      2
      • jsulmJ jsulm

        @MasterBlade Can you provide more information? Do you use break points? I mean, does your app stop at a break point? Does your app work properly if you don't debug it?

        M Offline
        M Offline
        MasterBlade
        wrote on last edited by
        #3

        @jsulm said in How to access qwindow while debugging:

        @MasterBlade Can you provide more information? Do you use break points? I mean, does your app stop at a break point? Does your app work properly if you don't debug it?

        Yes, I used break points and the program stops at a break point. The program worked all right if I don't debug it.

        My problem is that, when the program stops at a break point, I can't access the program or see what's going on in it. Whenever I click the app from Windows Task Bar, it just flashed in a second and then disappeared. From Windows Preview I can see it's still in its original form (my code changed a text on a label, but the preview shows an unchanged label).

        jsulmJ 1 Reply Last reply
        0
        • M MasterBlade

          @jsulm said in How to access qwindow while debugging:

          @MasterBlade Can you provide more information? Do you use break points? I mean, does your app stop at a break point? Does your app work properly if you don't debug it?

          Yes, I used break points and the program stops at a break point. The program worked all right if I don't debug it.

          My problem is that, when the program stops at a break point, I can't access the program or see what's going on in it. Whenever I click the app from Windows Task Bar, it just flashed in a second and then disappeared. From Windows Preview I can see it's still in its original form (my code changed a text on a label, but the preview shows an unchanged label).

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by jsulm
          #4

          @MasterBlade This is normal: if your program is waiting at a breakpoint then you can't interact with it (because it is paused). To be able to interact with it (and to see the changes in the UI) you need to continue the execution (F5).

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

          M 1 Reply Last reply
          3
          • jsulmJ jsulm

            @MasterBlade This is normal: if your program is waiting at a breakpoint then you can't interact with it (because it is paused). To be able to interact with it (and to see the changes in the UI) you need to continue the execution (F5).

            M Offline
            M Offline
            MasterBlade
            wrote on last edited by
            #5

            @jsulm said in How to access qwindow while debugging:

            @MasterBlade This is normal: if your program is waiting at a breakpoint then you can't interact with it (because it is paused). To be able to interact with it (and to see the changes in the UI) you need to continue the execution (F5).

            OK Got it.

            Is there a function to pause the program in the middle of something to leave me some time to watch what's going on?

            jsulmJ 1 Reply Last reply
            0
            • M MasterBlade

              @jsulm said in How to access qwindow while debugging:

              @MasterBlade This is normal: if your program is waiting at a breakpoint then you can't interact with it (because it is paused). To be able to interact with it (and to see the changes in the UI) you need to continue the execution (F5).

              OK Got it.

              Is there a function to pause the program in the middle of something to leave me some time to watch what's going on?

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @MasterBlade sleep(10); - sleep for 10 seconds, see https://linux.die.net/man/3/sleep

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

              M 1 Reply Last reply
              0
              • jsulmJ jsulm

                @MasterBlade sleep(10); - sleep for 10 seconds, see https://linux.die.net/man/3/sleep

                M Offline
                M Offline
                MasterBlade
                wrote on last edited by
                #7

                @jsulm said in How to access qwindow while debugging:

                @MasterBlade sleep(10); - sleep for 10 seconds, see https://linux.die.net/man/3/sleep

                No way. I used sleep(10); but still can't open the window while it's sleeping.

                jsulmJ 1 Reply Last reply
                0
                • M MasterBlade

                  @jsulm said in How to access qwindow while debugging:

                  @MasterBlade sleep(10); - sleep for 10 seconds, see https://linux.die.net/man/3/sleep

                  No way. I used sleep(10); but still can't open the window while it's sleeping.

                  jsulmJ Offline
                  jsulmJ Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  @MasterBlade As I said: you can't expect your UI to work if you block your app. How could it work?
                  You can try to call http://doc.qt.io/qt-5/qcoreapplication.html#processEvents just before you call sleep(), but this is only a work around.

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

                  1 Reply Last reply
                  2

                  • Login

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