Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to call function after window is shown?

Tags:

c++

qt

Using Qt I create a QMainWindow and want to call a function AFTER the windows is shown. When I call the function in the constructor the function (a dialog actually) get's called before the window is shown.

like image 377
HWende Avatar asked Jan 16 '13 10:01

HWende


1 Answers

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 }  
like image 63
Frank Osterfeld Avatar answered Sep 21 '22 05:09

Frank Osterfeld