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. gui event loop does not work
Qt 6.11 is out! See what's new in the release blog

gui event loop does not work

Scheduled Pinned Locked Moved Solved General and Desktop
8 Posts 5 Posters 2.9k Views 2 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.
  • D Offline
    D Offline
    danyal
    wrote on last edited by
    #1

    there is an application that has two labels for video output, and several more labels to output their size, which should rightly increase as the video displayed on the screen is recorded. I have the following problem: at some point in time (an average of a couple of minutes) everything in the application as-hangs. The numbers with the file size do not increase, the images from the camera do not change. but the debug output shows that the application is working. when I press the stop button, which stops the recording, the images in the labels instantly change to the current ones (my hand with the mouse, pushing the stop), the file sizes are displayed correctly and the application stops correctly, which is also visible on the debug output. I guess that at some point my application stops processing the events in the gui until I myself do not generate it (pressing a button). Which way should I look? Why can this happen?

    jsulmJ 1 Reply Last reply
    0
    • D danyal

      there is an application that has two labels for video output, and several more labels to output their size, which should rightly increase as the video displayed on the screen is recorded. I have the following problem: at some point in time (an average of a couple of minutes) everything in the application as-hangs. The numbers with the file size do not increase, the images from the camera do not change. but the debug output shows that the application is working. when I press the stop button, which stops the recording, the images in the labels instantly change to the current ones (my hand with the mouse, pushing the stop), the file sizes are displayed correctly and the application stops correctly, which is also visible on the debug output. I guess that at some point my application stops processing the events in the gui until I myself do not generate it (pressing a button). Which way should I look? Why can this happen?

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

      @danyal What you describe sounds like you're blocking the event loop. Are you doing heavy tasks in GUI thread? Do you have any long lasting loops in your GUI thread?

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

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

        Hi,

        You need to provide more details.

        What version of Qt are you using ?
        On what platform ?
        With which compiler ?
        How are these videos fed to your application ?
        Are you doing anything else in your application beside showing these videos ?

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

        D 1 Reply Last reply
        0
        • jsulmJ jsulm

          @danyal What you describe sounds like you're blocking the event loop. Are you doing heavy tasks in GUI thread? Do you have any long lasting loops in your GUI thread?

          D Offline
          D Offline
          danyal
          wrote on last edited by
          #4

          @jsulm My application is divided into two thread. The main thread is where the gui and audio record and the thread are for taking a picture from the camera (two images: color and depth of the intel realsense 300). After the main thread processes the start event and starts it all, it is more responsible for recording the sound with QAudioRecorder. And it also has to process events and signals. In this thread, 10 times a second, label with information about the size of files and a label with information and the duration of the application are updated. I just turned off and write about the size of the files and my application began to work longer. Now I turned off the audio recording and it seems to work even better. Could it be that the message queue just can not cope with so many messages?

          1 Reply Last reply
          0
          • SGaistS SGaist

            Hi,

            You need to provide more details.

            What version of Qt are you using ?
            On what platform ?
            With which compiler ?
            How are these videos fed to your application ?
            Are you doing anything else in your application beside showing these videos ?

            D Offline
            D Offline
            danyal
            wrote on last edited by
            #5

            @SGaist qt 5.10.1 , windows 10, msvc 14.0, video get from intel realsense sdk

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

              @danyal said in gui event loop does not work:

              Could it be that the message queue just can not cope with so many messages?

              Yes, if the thread emit too fast due to tight loop.
              Normally you slow it down a bit wiht something like
              QTimer::singleShot(1, this, &Task::doWork)
              Where doWork is the method that performs the processing in the
              QObject you used moveToThread on.
              (if using the worker approach)

              1 Reply Last reply
              4
              • Y Offline
                Y Offline
                Yi-Hsuan Huang
                wrote on last edited by Yi-Hsuan Huang
                #7

                Hey! I'm also using Qt5.10.1, windows 10, msvc 14.0, intel realsense sdk.
                I'm facing a problem in the rs_frame.hpp with some syntax errors.
                It's so weird. Did you face the same problem before?
                Or if you can share your .pro file or other helpful files?
                Thanks a lot!

                mrjjM 1 Reply Last reply
                0
                • Y Yi-Hsuan Huang

                  Hey! I'm also using Qt5.10.1, windows 10, msvc 14.0, intel realsense sdk.
                  I'm facing a problem in the rs_frame.hpp with some syntax errors.
                  It's so weird. Did you face the same problem before?
                  Or if you can share your .pro file or other helpful files?
                  Thanks a lot!

                  mrjjM Offline
                  mrjjM Offline
                  mrjj
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  Hi and welcome to the forums.
                  While not strictly Qt, if you paste the actual errors you get in/from rs_frame.hpp
                  someone might give a good guess on what is wrong.

                  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