[Tutor] Larger GUI design ?

Alan Gauld alan.gauld at freenet.co.uk
Tue Aug 22 18:15:26 CEST 2006

> I am now on a more ambitious project. There will be a main app 
> screen, some
> dialogue screens for more info etc and a backend script analysing a 
> database
> which will take some time to run.
> How to fit the GUI around it ?
> If I have my dlg_app.py  inhereting frm_app.py all is well until I 
> need a
> poppup dialogue.

Its usually better to make popups inherit directly from TopLevel 
than the parent form.

> Would I define another module say dlg_info.py with its frm_info.py

Its usually best to put each significant window/dialog in its own 
It makes them easier to reuse in other projects for one thing!

> would import and call when needed generating its own QT
> object and window.

Not sure how QT works so can't comment on that.

> app = QApplication(sys.argv)

Are you sure there isn't a QDialog base class somewhere in QT?
Thats usually been the case in other GUI toolkits I've used.

> Secondly my backend will take a while to run & I would like to 
> display a
> status bar in the GUI. The only way i can see to do this is to 
> either

Sounds like a job for a thread...

> (2) pass info from the backend via a socket (yep know about them 
> now!) to a QT
> script running in timerEvent()

You can do this but threads are less resource greedy.


Alan Gauld
Author of the Learn to Program web site

More information about the Tutor mailing list