关闭主窗口并打开一个新窗口 - PyQt [英] Close the main window and open a new one - PyQt
本文介绍了关闭主窗口并打开一个新窗口 - PyQt的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在PyQt中,有没有办法关闭主窗口并打开一个新窗口?
In PyQt, is it any way to close the main window and open a new one?
特别是,我试图关闭一个窗口并重新打开同一个窗口.我已经尝试了所有我能想到的方法,但都没有成功(有些会导致分段错误).我需要这样做,因为根据传递的参数,新窗口会有一些功能.
In particular, I am trying to close a window and open the same window all over again. I've tried every way I could think of without success (with some resulting in segmentation fault). I need to do this because the new window will have some features according to the parameters that are passed.
推荐答案
这个怎么样:
....
....
def selectMode( self ):
self.close()
self.field_params = params
self.show()
这篇关于关闭主窗口并打开一个新窗口 - PyQt的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文