Pradnyesh Sawant wrote:
why would one not use an IDE (especially one where one can drag-drop widgets onto a form) to create a gui? is it not more intuitive? is code generation not less cumbersome this way? especially with layouts; coz i just saw that qt4-designer does a very good job of laying out stuff, and that manually it would be very hard to place stuff at proper positions, and then configuring each petty detail of each widget
Actually it's just my personal preference. There's no harm in using the designer, but some advantages of manual coding are - (a) You have absolute control over code, (b) Well written code is self documenting, so you have a list of exactly what changes you have made to default properties of each widget and (c) This may not be important in many situations, but your own code tends to be smaller and neater than the generated code.
I sometimes use the designer to do an initial layout and then copy and paste modified bits into my final code. This is especially helpful when you're still learning the relevant calls for various properties of widgets. Of course, doing it manually negates the advantage of having a separate and easily modifiable file for the GUI components, but I personally find the advantages outweigh the disadvantages.
BTW, there isn't a problem with "manually it would be very hard to place stuff at proper positions" because Qt uses layouts like Java unlike say Visual Basic. So usually one doesn't position things using coordinates, just specifies the hierarchy. For example you're telling it that there is a dialog containing a frame containing a horizontal layout containing 3 buttons and an image. Actually compared to drawing out a dialog box in VB, using the Qt designer is a little more complicated because of this. But the initial complexity pays some nice dividends for both the end-user and the programmer: automatic widget positioning and layout allows easy resolution-independence, simple resizable windows and ultimately convenient portability.
P.S. I'm wondering if this thread isn't getting a bit too far off topic for the list. BTW, comp.lang.python is a very useful resource for this sort of stuff. If you're not a regular usenet user try: http://groups.google.com/group/comp.lang.python?hl=en
Chirag Wazir http://chirag.freeshell.org