PyQt blocking version of show()
I've got a fairly cpu-intensive application, but all of the cpu-intensive stuff is started by clicking a QPushButton. When the button is clicked, a hidden QLabel is show()n.
Apparently, show() is non-blocking. Unfortunately, this means that the cpu-intensive stuff is practically half-done before the label show()s up.
How can I make show blocking? Or how can I make the label show() right when I click the button?
Relevant code:
def parseFile(self):
self.refreshLabel.show() #h开发者_如何学运维idden by default
self.parse_triggered.emit()
parse_triggered causes the parent class to call the parse() function, which is pretty cpu-intensive.
Try calling processEvents()
after the call to show
.
精彩评论