0
在我的項目中,我有一個函數在QProgressDialog顯示進度的同時運行。QProgressDialog在另一個進程啓動時「關閉」
QProgressDialog progress("Saving savegame.dat...", "Abort Save", 0, 3016, this);
progress.setWindowModality(Qt::WindowModal);
//... some loops and other calculations run while I update the progress bar with:
progress.setValue(1000);
一切都很好,直到我開始另一個過程。 (打開一個命令行程序)
QProcess decomBR;
QStringList filePathListBR;
filePathListBR.append("-o");
filePathListBR.append("stuff\\compress.bms");
filePathListBR.append("stuff\\regions\\xbox_chunks\\br");
filePathListBR.append("stuff\\regions\\xbox_chunks\\br");
decomBR.start("stuff\\quickbms.exe", filePathListBR);
decomBR.waitForFinished();
由於爲這樣的過程一旦啓動,不再顯示進度條對話框隱藏或東西和進步,但仍流程運行良好。
任何方式來防止這些進程「關閉」QProgressDialog?
編輯:顯然,對話框不關閉,它只是主窗口優先和「覆蓋」對話框......如果這是有道理的。有沒有辦法讓對話框保持顯示優先?
感謝您的時間:)