【发布时间】:2013-09-29 03:14:19
【问题描述】:
在我的项目中,我有一个函数正在运行,而 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);
一切都很好,直到我开始另一个过程。 (打开一个cli程序)
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?
编辑:很明显,对话框并没有关闭,它只是主窗口优先并“覆盖”了对话框......如果这有意义的话。有什么办法可以让对话框保持显示优先级?
感谢您的宝贵时间 :)
【问题讨论】:
标签: c++ qt process modal-dialog