views:

42

answers:

1

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() #hidden by default
    self.parse_triggered.emit()

parse_triggered causes the parent class to call the parse() function, which is pretty cpu-intensive.

+2  A: 

Try calling processEvents() after the call to show.

TreDubZedd