Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Here's the gist. The application is still running and the progress bar will still move, but the window will grey out and if I click the X to close it, a popup shows up and says "The window X is not responding, Force Quit?" If I force quit it, the window closes, but I can see the application is still running when I run it from the terminal. I'm using QT 4.

share|improve this question
add comment

2 Answers 2

It sounds like the window is not being destroyed. Is this the main window of your application, or a dialog of some sort?

If it is a dialog, make sure that after you call your window object, the next line, or after the return value for the window is grabbed, you call "window_object.destroy()".

If it is your main window, you would perhaps want to modify the callback method for the X button with something to destroy your window, perhaps self.destroy()?

share|improve this answer
    
It's the main window of the application. How would I change the behavior of the close ( X ) button? It's in the title bar, not my program. –  Ian Hyzy Aug 17 '12 at 17:05
    
Try putting self.connect("delete-event", Gtk.main_quit) in your init. See here for the tutorial. –  Jobi Carter Aug 18 '12 at 16:35
add comment

The problem is most likely that while your download functions are running, your application can't respond to events - control doesn't return to the main loop.

I think the simplest mechanism is to do the downloads in separate threads, and use Qt's signals and slots mechanism to update the progress bars (threads can't interact directly with the user interface).

Also, rather than opening files to write the HTTP response out, you might find it more efficient to use a function like urllib.urlretrieve to write the files directly.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.