Results 1 to 5 of 5

Thread: signal/slot mechanism is totally independent of any GUI event loop

  1. #1
    Join Date
    Jan 2006
    Location
    Beijing
    Posts
    3
    Qt products
    Qt/Embedded
    Platforms
    Unix/X11 Windows

    Smile signal/slot mechanism is totally independent of any GUI event loop

    In Qt Documents about Signal/Slot, It says that "The signal/slot mechanism is totally independent of any GUI event loop" . How to comprehend this words? On my opinion, for example, if a user clicked a PushButton, the event loop will catch this event and a Clicked() signal will be sent ? If the connected slot will not return, the GUI will be blocked. So I am mazed about this words.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: signal/slot mechanism is totally independent of any GUI event loop

    Quote Originally Posted by twosnowman
    In Qt Documents about Signal/Slot, It says that "The signal/slot mechanism is totally independent of any GUI event loop" .
    It means that this mechanism will work even if you don't have a running event loop.

    Quote Originally Posted by twosnowman
    If the connected slot will not return, the GUI will be blocked.
    If you have only one thread, you can't execute different parts of your code simultaneously.

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: signal/slot mechanism is totally independent of any GUI event loop

    And not every signal is emited from an event handler.

  4. #4
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    85
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: signal/slot mechanism is totally independent of any GUI event loop

    Quote Originally Posted by jacek
    It means that this mechanism will work even if you don't have a running event loop.
    At least if you have multiple threads with queued connections this is wrong: Queued connections are only processed in the event loop: QThread::exec
    But all this works without a GUI, use QCoreApplication instead of QApplication.

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: signal/slot mechanism is totally independent of any GUI event loop

    Quote Originally Posted by Codepoet
    At least if you have multiple threads with queued connections this is wrong:
    Provided that you use Qt4, unlike the author of this thread.

Similar Threads

  1. Workload in a QThread blocks main application's event loop ?
    By 0xBulbizarre in forum Qt Programming
    Replies: 14
    Last Post: 9th April 2006, 21:55

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.