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. Blocked gui does not draw an qml item?
Qt 6.11 is out! See what's new in the release blog

Blocked gui does not draw an qml item?

Scheduled Pinned Locked Moved Solved QML and Qt Quick
15 Posts 6 Posters 2.5k 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.
  • PowerNowP PowerNow

    Thxs to all of you!
    But as I mentioned unfortunately I can't move at the moment the heavyFunct() (its a QFramebufferobject loaded via Loader which needs a lot of memory and power) into a separat threat, currently I'm looking for a simple solution.
    @J.Hilk: Yes this works thxs! But It's an app using a Videoframbuffer (highest possible frame rate) and i think only for this button always check the frameSwapped signal does not make me feel good. Or is there a way to check it only once?

    I only want to visually show the user if he press on the button, that he have to wait and not press again during the loading of the heavyFunct(). Is there no way to force Qml to update the scenegraph and give response? The locking of the gui is not that problem.

    raven-worxR Offline
    raven-worxR Offline
    raven-worx
    Moderators
    wrote on last edited by
    #6

    @PowerNow said in Blocked gui does not draw an qml item?:

    Or is there a way to check it only once?

    make the slot connected to the frameSwapped signal disconnect itself when it gets called

    --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
    If you have a question please use the forum so others can benefit from the solution in the future

    1 Reply Last reply
    1
    • PowerNowP PowerNow

      Thxs to all of you!
      But as I mentioned unfortunately I can't move at the moment the heavyFunct() (its a QFramebufferobject loaded via Loader which needs a lot of memory and power) into a separat threat, currently I'm looking for a simple solution.
      @J.Hilk: Yes this works thxs! But It's an app using a Videoframbuffer (highest possible frame rate) and i think only for this button always check the frameSwapped signal does not make me feel good. Or is there a way to check it only once?

      I only want to visually show the user if he press on the button, that he have to wait and not press again during the loading of the heavyFunct(). Is there no way to force Qml to update the scenegraph and give response? The locking of the gui is not that problem.

      T Offline
      T Offline
      Tom_H
      wrote on last edited by
      #7

      @PowerNow I solved a similar issue by using a Timer.

      PowerNowP 1 Reply Last reply
      1
      • PowerNowP PowerNow

        Thxs to all of you!
        But as I mentioned unfortunately I can't move at the moment the heavyFunct() (its a QFramebufferobject loaded via Loader which needs a lot of memory and power) into a separat threat, currently I'm looking for a simple solution.
        @J.Hilk: Yes this works thxs! But It's an app using a Videoframbuffer (highest possible frame rate) and i think only for this button always check the frameSwapped signal does not make me feel good. Or is there a way to check it only once?

        I only want to visually show the user if he press on the button, that he have to wait and not press again during the loading of the heavyFunct(). Is there no way to force Qml to update the scenegraph and give response? The locking of the gui is not that problem.

        KroMignonK Offline
        KroMignonK Offline
        KroMignon
        wrote on last edited by
        #8

        @PowerNow said in Blocked gui does not draw an qml item?:

        (its a QFramebufferobject loaded via Loader

        I'm not sure to understand how this works. Is the Loader a QML Loader instance?
        Why is this loader not set asynchronous to true?

        Loader {
            source: "myHeadyComponent.qml"
            asynchronous: true
            visible: status == Loader.Ready
        }
        

        It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

        PowerNowP 1 Reply Last reply
        0
        • KroMignonK KroMignon

          @PowerNow said in Blocked gui does not draw an qml item?:

          (its a QFramebufferobject loaded via Loader

          I'm not sure to understand how this works. Is the Loader a QML Loader instance?
          Why is this loader not set asynchronous to true?

          Loader {
              source: "myHeadyComponent.qml"
              asynchronous: true
              visible: status == Loader.Ready
          }
          
          PowerNowP Offline
          PowerNowP Offline
          PowerNow
          wrote on last edited by
          #9

          @KroMignon Hi, I just added asynchronous: true but surprisingly no change.

          KroMignonK 1 Reply Last reply
          0
          • PowerNowP PowerNow

            @KroMignon Hi, I just added asynchronous: true but surprisingly no change.

            KroMignonK Offline
            KroMignonK Offline
            KroMignon
            wrote on last edited by
            #10

            @PowerNow This sounds very strange to me. I often use asynchronous with Loader, and it always works.

            Does your huge QML component also includes Loader?

            It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

            PowerNowP 1 Reply Last reply
            0
            • KroMignonK KroMignon

              @PowerNow This sounds very strange to me. I often use asynchronous with Loader, and it always works.

              Does your huge QML component also includes Loader?

              PowerNowP Offline
              PowerNowP Offline
              PowerNow
              wrote on last edited by
              #11

              @KroMignon The loaded Qml component "only" consists of a big QFramebufferObject which loads a lot of data in the graphiccard and this blocks the gui. Further Loader are not included.

              T 1 Reply Last reply
              0
              • PowerNowP PowerNow

                @KroMignon The loaded Qml component "only" consists of a big QFramebufferObject which loads a lot of data in the graphiccard and this blocks the gui. Further Loader are not included.

                T Offline
                T Offline
                Tom_H
                wrote on last edited by
                #12

                @PowerNow Then you are either doing something wrong or using a non-threaded render loop. By default there is a dedicated render thread and a dedicated main GUI thread. Loading of data to the graphics card should happen in the render thread and won't block the GUI.

                Scene Graph and Rendering

                PowerNowP 1 Reply Last reply
                0
                • T Tom_H

                  @PowerNow I solved a similar issue by using a Timer.

                  PowerNowP Offline
                  PowerNowP Offline
                  PowerNow
                  wrote on last edited by
                  #13

                  @Tom_H I tried it with a timer but it also does not work.

                  Timer {
                     id: iTim
                     interval: 0
                     running: false
                     repeat: false
                     triggeredOnStart: true
                     onTriggered: {
                          console.log("onTriggered");
                          iBut1.mTxt = "wait"
                      }
                  }
                  

                  Without triggeredOnStart: true the triggerSignal is fired after the heavyFunct() is finished.

                  1 Reply Last reply
                  0
                  • T Tom_H

                    @PowerNow Then you are either doing something wrong or using a non-threaded render loop. By default there is a dedicated render thread and a dedicated main GUI thread. Loading of data to the graphics card should happen in the render thread and won't block the GUI.

                    Scene Graph and Rendering

                    PowerNowP Offline
                    PowerNowP Offline
                    PowerNow
                    wrote on last edited by
                    #14

                    @Tom_H How can I found out that I'm using a non-threaded render loop? In the QQuickFrambufferObject I'm using of course the QQuickFramebufferObject::Renderer.

                    "Communication between the item and the renderer should primarily happen via the QQuickFramebufferObject::Renderer::synchronize() function. This function will be called on the render thread while the GUI thread is blocked."

                    It's still not clear how the gui and scene graph render works together. Based on the Qt arcticles it seems so that the scene graph render blocks the gui during rendering.

                    Is the gui blocked during upload of big Vertex/Index buffer objects?

                    1 Reply Last reply
                    0
                    • PowerNowP Offline
                      PowerNowP Offline
                      PowerNow
                      wrote on last edited by
                      #15

                      For who is interessted, I handle the problem by using the pressed() signal.

                      MouseArea  {
                          property bool mRed: false
                      
                          onClicked: {
                             heavyFunct();
                             mRed = false;
                          }
                          onPressed: {
                             mRed = true;
                          }
                          onReleased: {
                             mRed = false;
                          }
                      }
                      
                      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