PyQt: app.exec_() stops all following code from running

后端 未结 4 500
野的像风
野的像风 2020-12-06 17:51

I have a code which looks like:

app = QApplication(sys.argv)
self.interface = Interface()

# The figure
self.fig = self.interface.fig
self.ax = self.fig.add_         


        
4条回答
  •  萌比男神i
    2020-12-06 18:06

    In addition to the previous answer, not every time when all windows are closed does the GUI event loop, run by app.exec_(), stop. If you want to terminate it manually you can use app.quit() inside any of the event handlers. It stops GUI event loop and launches your code after app.exec_().

    First answer is a lot of words about nothing.

提交回复
热议问题