【发布时间】:2019-04-17 15:50:59
【问题描述】:
如何使用下面的“for 循环”来立即更新窗口。 sleep(5) 只是看物品是否瞬间填满
我在一个简单的“类 MainWindow : public QMainWindow”中使用 Qt,带有一个按钮、一个 plainTextEdit 和一个 textEdit
for (int i=0; i < 10 ; i++ )
{
sentFrame = "toto"+i;
ui->alarmSent->addItem(sentFrame.toHex()); // filled at the end of for loop
ui->sentTest->insertPlainText(sentFrame.toHex()); // filled at the end of for loop
sleep(5);
}
【问题讨论】: