PyQtForSoftimage
PyQtForSoftimage copied to clipboard
Example Update: prevent multiple windows, kill app on close
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