Closing dialogue windows qiht PyQt

Hullo,

I've got some code that sets up a dialogue window, starts some external
commands, then starts the exec_loop for the dialogue. I've had to make the
exec_loop bit a new thread, as otherwise I'd have to put a button in the
dialogue window to start the external commands (both the exec_loop command
and the code to run the external commands hog the main thread, so without two
threads, I can only do one after the other, which is hopeless).

Anywho, when I connect a close button to the accept() slot, it closes both the
dialogue and its parent window. Is this something to do with the threading,
or some other reason? How can I make a button that will just close the
dialogue?

I'd be interested in any suggestions of how to handle the two threads better (perhaps not even using threads?)