Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example Update: prevent multiple windows, kill app on close #5

Open
tcrowson opened this issue Aug 27, 2012 · 0 comments
Open

Example Update: prevent multiple windows, kill app on close #5

tcrowson opened this issue Aug 27, 2012 · 0 comments
Assignees

Comments

@tcrowson
Copy link

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

@ghost ghost assigned caron Aug 27, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants