How to call function after window is shown?

If you want to do something while the widget is made visible, you can override QWidget::showEvent like this:

class YourWidget : public QWidget { ...

void YourWidget::showEvent( QShowEvent* event ) {
    QWidget::showEvent( event );
    //your code here
} 

Leave a Comment