I\'m having problems with a \"New Window\" function in PyQt4/PySide with Python 2.7. I connected a initNewWindow() function, to create a new window, to an actio
When initNewWindow() returns, the window variable is deleted and the window's reference count drops to zero, causing the newly created C++ object to be deleted. This is why your window closes immediately.
If you want to keep it open, make sure to keep a reference around. The easiest way to do this is to make your new window a child of the calling window, and set its WA_DeleteOnClose widget attribute (see Qt::WidgetAttribute).