Results 1 to 7 of 7

Thread: How to delay a Signal?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: How to delay a Signal?

    Since I hate my work right now and the van Damme movie, I currently watch, sucks, I am gentile and post the code I was thinking of...
    Qt Code:
    1. /// local timer t.
    2. XX::XX()
    3. {
    4. t.setSingleShot(true);
    5. connect(&t, SIGNAL(timeout()), this, SLOT(timerslot()));
    6. }
    7.  
    8. XX::timerslot()
    9. {
    10. // if you want do so something right here, if not, you could
    11. // direct emit the signal in the connect statement.
    12. emit mouseFor3SecondsOverWidget();
    13. }
    14.  
    15. XX::enterEvent()
    16. {
    17. t.start(3000);
    18. }
    19.  
    20.  
    21. XX::enterLeave()
    22. {
    23. t.stop();
    24. }
    To copy to clipboard, switch view to plain text mode 

  2. The following user says thank you to Lykurg for this useful post:

    trusch (26th June 2009)

  3. #2
    Join Date
    Jun 2009
    Posts
    7
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to delay a Signal?

    Thanks a lot!

Similar Threads

  1. pthread instead QThread
    By brevleq in forum Qt Programming
    Replies: 8
    Last Post: 23rd December 2008, 07:16
  2. Connection of custon signals/slots
    By brevleq in forum Qt Programming
    Replies: 2
    Last Post: 23rd December 2008, 07:04
  3. Possible signal mapper problem
    By MarkoSan in forum Qt Programming
    Replies: 13
    Last Post: 25th January 2008, 13:11
  4. Replies: 2
    Last Post: 17th May 2006, 21:01

Tags for this Thread

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
  •  
Qt is a trademark of The Qt Company.