开发者

QFileDialog painting problem while multithreading

I have two threads, the main one for GUI and the other for intense processing.

A signal/slot connection 'connects' the threads so that when the proc thread emits the signal, a new QWidget is added on the GUI by the main thread's slot.

The problem is that I want to diplay a QFileDialog::getOpenFileName when the user clicks a file menu item during the processing described above by the two threads.

The dialog appears on the screen, but its contents are not drawn until the intense processing f开发者_StackOverflow中文版inishes (and all QWidgets are added to the GUI because of the conection).

How can I make the QFileDialog paint and act before the intense processing thread finishes?

I've hit a wall with this, nothing I tried worked.. please help :)


In the handler you could use a list where you push the new items to be drawn on while you display the QFileDialog. When you are done with the QFileDialog you process all the items that are in this list.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜