我想在关闭子窗口后执行一个函数,这是我的代码,它没有按预期工作
Preferences *dialog = new Preferences();
connect(dialog,SIGNAL(destroyed()),this,SLOT(LoadSettings()));
dialog->show();
编辑:看来我错误地选择了 QmainWIndow 作为首选项对话框:-(,我可以在不将其移植到 Qdialog 的情况下解决这个问题吗?或者有什么简单的方法可以将 Qmainwindow ui 移植到 Qdialog ui
最佳答案
Preferences *dialog = new Preferences();
connect(dialog,SIGNAL(destroyed()),this,SLOT(LoadSettings()));
dialog->exec();
delete dialog;
关于c++ - QT关闭子窗口后如何执行函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21435089/