c++ - When will widgets update after widget visibility change in Qt? -


i want change visibility of 2 widgets 1 one. in case, need process sleep 1s , change visibility of widgeta. , sleep 1s chnage visibility of widgetb. code.

...// process d  sleep(1000);  widgeta->setvisible(true);           sleep(1000);  widgetb->setvisible(true); 

but result not want. widgeta , widgetb 's visibility have been changed in same time after more 2s after process d finished.

  1. why widgeta , widgetb's visibility have been changed in same time? don't change in realtime when widgeta->setvisible(true); have been executed? when widgets update?

  2. why more 2s ?

void mainwindow::initialize() {     sleep(1000);     widgeta->installeventfilter( );     widgeta->setvisible( true ); }  bool mainwindow::eventfilter( qobject *object, qevent *event ) {     if( object == widgeta )     {         if( event->type() == qevent::show )         {             sleep(1000);             widgetb->setvisible( true );         }     }     return qmainwindow::eventfilter( object, event ); } 

Comments

Popular posts from this blog

ios - MKAnnotationView layer is not of expected type: MKLayer -

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -