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. What's the alternative of api 'hasPendingEvents'?
QtWS25 Last Chance

What's the alternative of api 'hasPendingEvents'?

Scheduled Pinned Locked Moved Unsolved General and Desktop
event handling
14 Posts 6 Posters 797 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.
  • Z Offline
    Z Offline
    Zuuka
    wrote on 13 Mar 2025, 12:55 last edited by
    #5

    What if i want to be sure that no more Events are beeing processed or queued before continuing e.g. cleanup etc..?!
    Should i use processEvents(AllEvents) instead?!

    J 1 Reply Last reply 13 Mar 2025, 13:02
    0
    • Z Zuuka
      13 Mar 2025, 12:55

      What if i want to be sure that no more Events are beeing processed or queued before continuing e.g. cleanup etc..?!
      Should i use processEvents(AllEvents) instead?!

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 13 Mar 2025, 13:02 last edited by
      #6

      @Zuuka As long as you're busy doing something the event queue is blocked and will not process any events.

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

      1 Reply Last reply
      0
      • Z Offline
        Z Offline
        Zuuka
        wrote on 13 Mar 2025, 13:10 last edited by Zuuka
        #7

        can i query if it is blocked?
        In my case i just want to cleanup a Test class, and verify that all events have been processed before continuing with the cleanup.

        J C 2 Replies Last reply 13 Mar 2025, 15:00
        1
        • Z Zuuka
          13 Mar 2025, 13:10

          can i query if it is blocked?
          In my case i just want to cleanup a Test class, and verify that all events have been processed before continuing with the cleanup.

          J Offline
          J Offline
          jsulm
          Lifetime Qt Champion
          wrote on 13 Mar 2025, 15:00 last edited by
          #8

          @Zuuka said in What's the alternative of api 'hasPendingEvents'?:

          can i query if it is blocked?

          Why? As I said: as long as your code is doing something (like a slot being executed) the event loop is blocked (means: it can't process events). There is no need to query anything.

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

          1 Reply Last reply
          2
          • S Offline
            S Offline
            SGaist
            Lifetime Qt Champion
            wrote on 13 Mar 2025, 20:17 last edited by
            #9

            Hi,

            Out of curiosity, are you using QTest ?

            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
            1
            • Z Offline
              Z Offline
              Zuuka
              wrote on 14 Mar 2025, 08:00 last edited by
              #10

              Yes, i am using QTest :)

              J 1 Reply Last reply 14 Mar 2025, 09:09
              0
              • Z Zuuka
                14 Mar 2025, 08:00

                Yes, i am using QTest :)

                J Offline
                J Offline
                JonB
                wrote on 14 Mar 2025, 09:09 last edited by
                #11

                @Zuuka Then wait patiently, and doubtless @SGaist will have some suggestion on this for you :)

                1 Reply Last reply
                0
                • Z Zuuka
                  13 Mar 2025, 13:10

                  can i query if it is blocked?
                  In my case i just want to cleanup a Test class, and verify that all events have been processed before continuing with the cleanup.

                  C Offline
                  C Offline
                  Christian Ehrlicher
                  Lifetime Qt Champion
                  wrote on 14 Mar 2025, 09:21 last edited by
                  #12

                  @Zuuka said in What's the alternative of api 'hasPendingEvents'?:

                  hat all events have been processed before continuing with the cleanup.

                  What exact events?

                  Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                  Visit the Qt Academy at https://academy.qt.io/catalog

                  1 Reply Last reply
                  1
                  • Z Offline
                    Z Offline
                    Zuuka
                    wrote on 17 Mar 2025, 13:50 last edited by
                    #13

                    I think those are Custom Events.

                    1 Reply Last reply
                    0
                    • C Offline
                      C Offline
                      Christian Ehrlicher
                      Lifetime Qt Champion
                      wrote on 17 Mar 2025, 13:53 last edited by
                      #14

                      Ok - why are they important? If they are that important then you also have to check for them in the first place. Use an event filter for example.

                      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                      Visit the Qt Academy at https://academy.qt.io/catalog

                      1 Reply Last reply
                      1

                      14/14

                      17 Mar 2025, 13:53

                      • Login

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