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.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论