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. pyqtSignal is processed after a long time
Forum Updated to NodeBB v4.3 + New Features

pyqtSignal is processed after a long time

Scheduled Pinned Locked Moved Unsolved Qt for Python
8 Posts 3 Posters 1.1k 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.
  • T Offline
    T Offline
    TechMan
    wrote on last edited by
    #1

    Dear all,
    I have a situation which looks like a pyqtSignal is processed after a long time (minutes) after it has been emitted.
    Is there a way then to check for pending signals or apply priority to signals or whatever... What is the proper way to do in this situation?
    Thanks.

    jsulmJ 1 Reply Last reply
    0
    • T TechMan

      Dear all,
      I have a situation which looks like a pyqtSignal is processed after a long time (minutes) after it has been emitted.
      Is there a way then to check for pending signals or apply priority to signals or whatever... What is the proper way to do in this situation?
      Thanks.

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

      @TechMan Signals are only proccessed if the event loop is executed.
      So, the question is: do you block the event loop? The event loop can be blocked when you execute a long lasting loop or if you call a blocking function.

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

      T 1 Reply Last reply
      2
      • jsulmJ jsulm

        @TechMan Signals are only proccessed if the event loop is executed.
        So, the question is: do you block the event loop? The event loop can be blocked when you execute a long lasting loop or if you call a blocking function.

        T Offline
        T Offline
        TechMan
        wrote on last edited by
        #3

        @jsulm
        I do not forcibly block the event loop in any way, but I think there can be just many messages being sent to that event loop, causing a particular signal to wait for a long time. But how to check that to make sure? Is it possible to check message queue somehow?
        I work with Python/PyCharm

        jsulmJ 1 Reply Last reply
        0
        • T TechMan

          @jsulm
          I do not forcibly block the event loop in any way, but I think there can be just many messages being sent to that event loop, causing a particular signal to wait for a long time. But how to check that to make sure? Is it possible to check message queue somehow?
          I work with Python/PyCharm

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

          @TechMan said in pyqtSignal is processed after a long time:

          causing a particular signal to wait for a long time

          Signals are processed in the same order they were emitted.
          How many signals do you emit? How is the system load when your app is running? What is your app doing?

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

          T 1 Reply Last reply
          0
          • jsulmJ jsulm

            @TechMan said in pyqtSignal is processed after a long time:

            causing a particular signal to wait for a long time

            Signals are processed in the same order they were emitted.
            How many signals do you emit? How is the system load when your app is running? What is your app doing?

            T Offline
            T Offline
            TechMan
            wrote on last edited by
            #5

            @jsulm

            How many signals do you emit?

            Few signals, but I'm aware that some of message processing functions can be long lasting. So I suspect that messages can accumulate. My question is: is there any mean to check that? Is there any mean to check - how many messages are in the queue at the moment?

            jsulmJ JonBJ 2 Replies Last reply
            0
            • T TechMan

              @jsulm

              How many signals do you emit?

              Few signals, but I'm aware that some of message processing functions can be long lasting. So I suspect that messages can accumulate. My question is: is there any mean to check that? Is there any mean to check - how many messages are in the queue at the moment?

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

              @TechMan said in pyqtSignal is processed after a long time:

              Is there any mean to check - how many messages are in the queue at the moment?

              I don't know.
              But what you can check is how long processing your messages takes.

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

              T 1 Reply Last reply
              0
              • jsulmJ jsulm

                @TechMan said in pyqtSignal is processed after a long time:

                Is there any mean to check - how many messages are in the queue at the moment?

                I don't know.
                But what you can check is how long processing your messages takes.

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

                @jsulm
                OK, thank you for you help.

                1 Reply Last reply
                0
                • T TechMan

                  @jsulm

                  How many signals do you emit?

                  Few signals, but I'm aware that some of message processing functions can be long lasting. So I suspect that messages can accumulate. My question is: is there any mean to check that? Is there any mean to check - how many messages are in the queue at the moment?

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

                  @TechMan said in pyqtSignal is processed after a long time:

                  Is there any mean to check - how many messages are in the queue at the moment?

                  This has been asked before, and I believe the answer is no, Qt hides that from you.

                  There is a QSignalSpy class, which can help monitor, but requires you to know/place it on the emitting objects, which is a bit of a pain. Or https://doc.qt.io/GammaRay/ may help, though I never got around to setting it up.

                  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