我有一个Qt快速窗口:
Window{
id: mainWindow
...
}
我想在QML中进行长时间阻止操作之前显示一个消息框:
// Set visible=true of 'messageBox' Rectangle{}
messageBox.showWaitMessage("Please wait")
// I want to show it before blocked the screen
mainWindow.requestUpdate()
// Long blocking operation:
compressFile("filepath")
屏幕上的所有对象都是mainWindow
的子对象。
但是它不起作用。阻止操作之前,它仍然不会重绘屏幕。
为什么?