Results 1 to 3 of 3

Thread: execute function after widget is displayed.

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: execute function after widget is displayed.

    You can use a 0 millisecond single shot timer started from the constructor of the dialog to call the function (as a slot) after the program returns to the event loop.
    Qt Code:
    1. MyDialog()
    2. {
    3. ...
    4. QTimer::singleShot(0, this, SLOT(doLongRunningThings()));
    5. }
    6.  
    7. /* public or private slot */
    8. void doLongRunningThings()
    9. {
    10. }
    To copy to clipboard, switch view to plain text mode 

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

    quain (6th December 2010)

Similar Threads

  1. Replies: 1
    Last Post: 1st December 2010, 23:16
  2. EXC_BAD_ACCESS error when widget is displayed
    By sparticus_37 in forum Qt Programming
    Replies: 0
    Last Post: 19th August 2010, 06:55
  3. Replies: 2
    Last Post: 30th July 2010, 15:59
  4. Dynamic widget not displayed upon Qwidget
    By ashukla in forum Qt Programming
    Replies: 5
    Last Post: 17th December 2007, 11:11
  5. Replies: 1
    Last Post: 20th November 2007, 18:42

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.