c++ - QtMainWindow initialized event -


i need start job when qmainwindow , widgets initialized , rendered.

how can catch such event?

i see 2 ways of doing this.

sophisticated:

void mainwindow::showevent(qshowevent *e) {     qmainwindow::showevent(e);     static bool firststart = true;     if (firststart)     {         emit startjob();         firststart = false;     } } 

and easy 1 (suitable only, if show main window right after creating):

mainwindow::mainwindow(qwidget *parent) :     qmainwindow(parent) {     ...     qtimer::singleshot(500, this, slot(job())); } 

update:

like chris said, showevent more appropriate here, paintevent.


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -