Close the main window and open a new one - PyQt

pyqt, pyqt4, qt, qt4

Solution

How about this:

....
....

def selectMode( self ):
    self.close()
    self.field_params = params

    self.show()

Problem

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.

Original source