Results 1 to 2 of 2

Thread: Confusion about events posted from slots

  1. #1
    Join Date
    Jul 2009
    Posts
    40
    Thanks
    7

    Default Confusion about events posted from slots

    Hello

    If I have the following code
    Qt Code:
    1. void someslotFunc()
    2. {
    3. qApp->postEvent(QEvent::SomeEventType);
    4. }
    To copy to clipboard, switch view to plain text mode 

    When the posted event will be processed ? When control gets to the main loop, right? Or it will be processed inside the slot?
    Think that the case is when control gets to the main loop, but I am not sure
    Thanks

  2. #2
    Join Date
    Dec 2007
    Posts
    628
    Thanks
    3
    Thanked 89 Times in 87 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Confusion about events posted from slots

    Quote Originally Posted by elizabeth.h1 View Post
    When the posted event will be processed ? When control gets to the main loop, right?
    Right !
    When control returns to the main event loop.
    You can also use QApplication::sendEvent(&event) if you want to send event without queue.

  3. The following user says thank you to yogeshgokul for this useful post:

    elizabeth.h1 (29th September 2009)

Similar Threads

  1. Signals and Slots Problem
    By GenericProdigy in forum Qt Programming
    Replies: 4
    Last Post: 2nd February 2009, 09:06
  2. QGraphicsView Mouse Events
    By tomf in forum Qt Programming
    Replies: 5
    Last Post: 29th July 2008, 15:03
  3. Replies: 12
    Last Post: 23rd June 2008, 08:05
  4. How to suppress user defined events in processEvents()
    By Artschi in forum Qt Programming
    Replies: 5
    Last Post: 5th July 2007, 10:17
  5. Adding slots in Designer
    By jamos in forum Qt Tools
    Replies: 5
    Last Post: 18th May 2006, 23:28

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.