Results 1 to 3 of 3

Thread: When does show a window?

  1. #1
    Join Date
    May 2006
    Posts
    57
    Thanks
    12
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Question When does show a window?

    I Use Qt 4.7.4

    I have a widget inside a QMainWindow (central widget)
    How I can know when finished display the window?

    I need to load data but these data depend on the space you have QGraphicsView, I need to load data but these data depend on the space you have QGraphicsView, I load the data window after the show ended.

    Thanks

  2. #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: When does show a window?

    You can cause processing to be done when the event loop is reached (which is where any pending window painting will happen) by using a single shot timer in your constructor. see How can i check if QMainWindow is fully loaded ?

    At least I think that is what you were after.

  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: When does show a window?

    If Chris is wrong and you want to do something after the widget is shown, you can override showEvent() for your widget, and post an event, start a singleshot 0 timeout timer or use QMetaObject::invokeMethod() with Qt::QueuedConnection to trigger code execution after the control returns to the event loop after the widget is shown. Just make sure you don't execute the code each time the widget is shown.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Replies: 3
    Last Post: 17th March 2010, 16:47
  2. [HELP] window won't show after build
    By jsmi in forum Newbie
    Replies: 3
    Last Post: 9th March 2010, 22:17
  3. Show advertising window
    By jano_alex_es in forum Qt Programming
    Replies: 2
    Last Post: 8th January 2010, 12:03
  4. Show parent window
    By Qt Coder in forum Qt Programming
    Replies: 7
    Last Post: 8th June 2009, 09:19
  5. How to show a window widget...
    By agent007se in forum Newbie
    Replies: 3
    Last Post: 20th July 2006, 10: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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.