[Tutor] Larger GUI design ?

Dave S pythontut at pusspaws.net
Tue Aug 22 14:01:16 CEST 2006

I have managed to write a small GUI app, it had a frm_app.py from eric3s QT 
designer & a dlg_app.py which defined a class that inherited the frm_app.py 
class ... all AOK

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.

The backend script is almost there, just tons of auditing rules to write for 
it but the backend 'engine' is working.

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.

Would I define another module say dlg_info.py with its frm_info.py which I 
would import and call when needed generating its own QT object and window. 
And in that module code something like the following would make the window on 
the fly ?

	app = QApplication(sys.argv)
	win =  info()
	QObject.connect(app, SIGNAL('lastWindowClosed()'),app, SLOT('quit()'))

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

(1) make my backend a class & inherit dlg_app.py so I can access the QT widget 
directly or 

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

Which is the best method ? Or is there a better way ?


More information about the Tutor mailing list