Tachyons
Tachyons

Reputation: 2171

how to execute a function after closing a child window in QT

I want to execute a function after closing a child window , here is my code, this do not work as expected

Preferences *dialog = new Preferences();
connect(dialog,SIGNAL(destroyed()),this,SLOT(LoadSettings()));
dialog->show();

Edit: It seems that I mistakenly chose QmainWIndow for preference dialog :-( , can I fix this without porting it into Qdialog? Or is there any easy way to port Qmainwindow ui to Qdialog ui

Upvotes: 1

Views: 847

Answers (1)

0xFFFFFFFF
0xFFFFFFFF

Reputation: 852

Preferences *dialog = new Preferences();
connect(dialog,SIGNAL(destroyed()),this,SLOT(LoadSettings()));
dialog->exec();
delete dialog;

Upvotes: 1

Related Questions