在Qt Creator中我有一個mainwindow和一個QWidget作爲工具窗口(setWindowFlags(Qt :: tool))。當我調用工具窗口時,用戶可以更改一些設置。這些更改會改變主窗口中的一些數據。當子窗口顯示在Qt中時暫停功能
我創建窗口小部件,顯示它,然後我想更新mainwindow中的數據,但該函數不會等待窗口小部件關閉。因此,演出後的更新程序將被亞馬遜執行並且不起作用。當我顯示一個QMessageBox時,函數等待用戶關閉它。
是否有一個標誌或我可以爲QWidget設置,以便函數等待?
void userclicksonsettings(){
settings = new Settings(this); // Settings is a QWidget-class with ui
settings->show();
// function should wait till settings is closed
// set up mainwindow with new values
}
謝謝。