View Full Version : mel style deleteUI with PyQt
05-24-2012, 12:41 PM
anyone know how to do this with pyqt,
if (`window -ex $window`)
i assume i need to get a pointer to the window and use sip
to get a pyQt object then window.close() just not sure how
05-24-2012, 10:22 PM
you can use sip.delete(YourWidgetInstance) method. I haven't use it to destroy QMainWindow though, assuming it would work since it is a widget too.
however I suggest you check bool QWidget::close () method.
I think the simplest way to replicate the mel behavior in PyQt is to call your window like this:
win = MyGUI()
If an instance of that window is currently running, it will close it before creating a new one.
05-25-2012, 02:40 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2015, Jelsoft Enterprises Ltd.