Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. When processing takes place the GUI does not respond until the end of the processing...
Forum Updated to NodeBB v4.3 + New Features

When processing takes place the GUI does not respond until the end of the processing...

Scheduled Pinned Locked Moved Unsolved Qt for Python
7 Posts 4 Posters 506 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.
  • J Offline
    J Offline
    john_hobbyist
    wrote on last edited by
    #1

    Hello! So, I have built a GUI with buttons that some of them do a lot of processing, when chosen. For example 20 minutes image processing. During that time I cannot select anything from the rest of the buttons until the 20 min processing stops. Is this normal? How can I handle such kind of situations? A progress bar? Thread level programming? Something else that I miss?

    jsulmJ 1 Reply Last reply
    0
    • J john_hobbyist

      Hello! So, I have built a GUI with buttons that some of them do a lot of processing, when chosen. For example 20 minutes image processing. During that time I cannot select anything from the rest of the buttons until the 20 min processing stops. Is this normal? How can I handle such kind of situations? A progress bar? Thread level programming? Something else that I miss?

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

      @john_hobbyist said in When processing takes place the GUI does not respond until the end of the processing...:

      Is this normal?

      If you do that processing in GUI thread then yes it is notmal.
      Solution: move processing to another thread(s). See https://doc.qt.io/qt-6/thread-basics.html

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

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

        Hi,

        Beside the point made by @jsulm, if you need to stop the processing early, don't forget to add escape points on a regular basis in your image processing code.

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

        J 1 Reply Last reply
        1
        • SGaistS SGaist

          Hi,

          Beside the point made by @jsulm, if you need to stop the processing early, don't forget to add escape points on a regular basis in your image processing code.

          J Offline
          J Offline
          john_hobbyist
          wrote on last edited by
          #4

          @SGaist What do you mean??

          JonBJ 1 Reply Last reply
          0
          • J john_hobbyist

            @SGaist What do you mean??

            JonBJ Offline
            JonBJ Offline
            JonB
            wrote on last edited by JonB
            #5

            @john_hobbyist
            @SGaist means: the user may not be prepared to sit there for 20 minutes(!). Once your UI is enabled again (by putting the processing into a background thread), you really should allow the user to be able to do something in the UI to indicate he wants it to stop. Such as: in the thread during the processing call bool QThread::isInterruptionRequested() const frequently somewhere, so that something from the UI can call void QThread::requestInterruption() if the user requests it.

            1 Reply Last reply
            1
            • J Offline
              J Offline
              john_hobbyist
              wrote on last edited by john_hobbyist
              #6

              A question a bit irrelevant. Can CUDA cores of my GPU, help somehow? I mean can they accelerate the image process? Instead using the pythreads...

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

                You have to use a library that makes use of your GPU(s) for the operations you want.

                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