Results 1 to 4 of 4

Thread: Event when application form has loaded? (onload)

  1. #1
    Join Date
    May 2009
    Posts
    10
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Event when application form has loaded? (onload)

    I would like to know when the QT application has finished loading so I can start doing some stuff.

    I do not know if I'm thinking about this in the wrong way but I want to run a function when the application has finished loading and the only way I can think of is to make a connection between some event and my function but I do not seem to be able to find any good event for this.

    Please advice.

    (Qt 4.6, Windows, GUI app with one form)

  2. #2
    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: Event when application form has loaded? (onload)

    Do you use threads? If not all function calls are proceed one after the other, so normally no "onload" is needed. E.g. after calling the constructor of your gui class simple call your other function and it behaves like you want.

  3. #3
    Join Date
    May 2009
    Posts
    10
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Event when application form has loaded? (onload)

    Quote Originally Posted by Lykurg View Post
    Do you use threads? If not all function calls are proceed one after the other, so normally no "onload" is needed. E.g. after calling the constructor of your gui class simple call your other function and it behaves like you want.
    Yes, I use threads and the solution seems to be to start a thread in my constructor.

    For some reason I do not find this solution to be as clean as it could be.
    If I was not using threads then I would call a function, from the constructor, that would loop for the entire duration of the program.

  4. #4
    Join Date
    Apr 2010
    Posts
    769
    Thanks
    1
    Thanked 94 Times in 86 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Event when application form has loaded? (onload)

    Your main widget/application is fully constructed and visible once the main show() function returns. See the QSplashScreen documentation for an example.

    Not sure if this is exactly what you're looking for.

Similar Threads

  1. [Qt4.5] event(QEvent * event) freeze application
    By czlowiekcien in forum Newbie
    Replies: 2
    Last Post: 25th May 2009, 20:25
  2. directfb plugin of qte.4.4.3 can not be loaded when running application
    By xianshuiren in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 15th February 2009, 05:54
  3. Run an application but show it in your own form?
    By triperzonak in forum Qt Programming
    Replies: 6
    Last Post: 27th September 2008, 02:37
  4. Close Event for DialogBased Application.
    By merry in forum Qt Programming
    Replies: 1
    Last Post: 12th December 2007, 12:33
  5. How to post a key event to another application
    By mitskits in forum Qt Programming
    Replies: 1
    Last Post: 23rd June 2006, 13:09

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.