PyQtForSoftimage icon indicating copy to clipboard operation
PyQtForSoftimage copied to clipboard

Example Update: prevent multiple windows, kill app on close

Open tcrowson opened this issue 13 years ago • 0 comments

As per our discussion on the List, just wanted to request an update to the sample script with examples of how to prevent multiple windows from spawning, and how to kill the app on close.

Got this from Ana Gomez. Thanks Ana!

To kill the app on close, in the class constructor include the following (In my case, immediately after loading the ui via uic) self.setAttribute(QtCore.Qt.WA_DeleteOnClose)

To prevent multiple spawns, in the Execute() definition, after setting sianchor: for child in sianchor.children(): if isinstance(child, YourDialogClassHere): return

tcrowson avatar Aug 27 '12 19:08 tcrowson