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. Mainloop QEventloop and Reposting events (help)
Qt 6.11 is out! See what's new in the release blog

Mainloop QEventloop and Reposting events (help)

Scheduled Pinned Locked Moved General and Desktop
3 Posts 3 Posters 1.2k 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.
  • R Offline
    R Offline
    RavensAngel
    wrote on last edited by
    #1

    All,

    i read about a method of making something async sync, by using an QEventloop...

    I don't want to start the discussion of whether this is the way to go or not. But i want to talk about the possibilities i have to prevent certain events to be processed.

    So what i want to reach is that within the eventloop i only accept the events (signals etc...) that i need, and somehow repost all other events back on the loop (for example the mainloop). Is this possible?

    For example:

    I have a mainloop running, and i started a worker thread... on a certain moment i want to do a third thing, which is normally async, but using the QEventloop method, i can make it sync.
    Currently the signals triggered by my worker thread are handled (eventhough i used queued connections) as they are being processed by the QEventloop i started to process the third thing.
    I know that i can filter certain events by setting an event filter. But i can only either process (accept them) or block them (in which case the event is lost)....
    So the question: can i put a filter which does not block the events, but reposts them again ... after i removed then the filter, the events will get processed eventually.

    Is this clear? And is it possible?

    THANKS!

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

      Hi,

      More or less clear, from the top of my head I would say no. You will probably have to look at QAbstractEventDispatcher

      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
      • IamSumitI Offline
        IamSumitI Offline
        IamSumit
        wrote on last edited by
        #3

        Hiii
        Do you want to post your event?
        May be following link could be helpful to you

        http://www.qtcentre.org/threads/17696-postEvent-and-multithreading

        Be Cute

        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