我这里有个循环,执行起来比较耗时间(5秒左右),因此想在执行期间在状态栏上显示一些信息给用户。我是这么做的:
[pre]forth_statusLabel->setText(tr("正在处理。。。"));[/pre]for(i = 0; i < fileList.count();++i)[pre] {[/pre][pre] fileName = targetDir + fileList[i];[/pre][pre] proceed(dir.path() + QString("/") + fileList.at(i));//eg:"c:/2005-100/1/1004"[/pre][pre] }[/pre][pre] forth_statusLabel->setText(tr("已结束。"));
但是程序并没有显示出“正在处理”,在for循环结束后直接显示"已结束"。在for循环执行时程序没有响应。
为什么上面的信息没有显示出来?如果这样做不对,那么该怎么做呢?
[/pre]