Skip to content

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

Description

@tcrowson

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions