Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Using a GUI Designer vs. hard coding
After looking at some videos it appears that these GUI Designers like Glade and FormBuilder are to be used outside of your Python IDE. I have Wing Pro and I assumed that you would download a GUI Designer and you would use it inside your IDE.

But I guess not. Looks like they function on their own.

Do you guys hard code your Windows programs inside the IDE that you are using or do you use a GUI Designer?

If I'm wrong with my earlier observations please point that out to me.
Both are useful. The GUI designer is great to quickly setup a layout for a simple application. It takes little work to make a pretty GUI, and you can modify it effortlessly. You may also study the generated code to take full control of the code if needed. On the other hand, the advantage of writing the windows from scratch is all about control, the code is cleaner and you can subclass the widgets as needed.
My opinion on the Designer (specifically because I have not seen the others) is that it should only be used to create fast proto-types because the code it generates is just so much garbage that using it for an actual production piece is ludicrous as it would simply create so many headaches and coding delays down the road.

Further it really does not take all that long to whip up a coded version (which btw is no less hard-coded than designer code is so not sure where that comparison comes from -- its just hard-coded cleanly or like garbage) in fact once you understand how to code a pyqt GUI from scratch and have done it properly a few times you will end up doing a lot of copy/paste which makes it even faster than using the designer with the added benefit of being something that can be easily worked with rather than the nightmare code that the Designer barfs out.

As a side Note -- I have converted a dozen or more of these designer projects into clean coded versions and most of the time it takes me less than an hour to do so which might have been about how long they took to create in the first place. Again if you are using the Designer for production code you are shooting yourself in the foot and eventually you will understand why I say that if you do not already.
I only do programming for a personal hobby. My programs are simple nothing too complicated. I will be writing a psychology test so my therapist can have some fun taking the test I created. I'm kind of leaning in the direction of hand-coding it once I reach that point where I want to start this project.
Great if the GUI is simple then it would be even faster to code up properly.
For a simple GUI, the designer can be a good choice. I think messy code would be more suited than garbage to describe the auto-generated code. Everything that needs to be there is there, but the variable naming scheme and overall organization is quite a mess (it is not meant to be read).

If you want, you can even use both. In a rather complex app, I left a blank space for some widgets that need to be subclassed, but I still use designer for the overall layout. In the end, writing the layout from scratch is the best way to do it, but definitely not the easiest. IMO that part is quite boring and placing the widget in a grid layout is no fun at all.
No I call it garbage because that is what it looks like a pile of garbage when you go to look at it Yeah everything is there because it works but its not structured nearly at all like it ought to be using layouts and I know this because as I stated I have converted a dozen or more of these into properly coded pyqt and the difference is like night and day -- where the stuff before is like night hard to see and thus hard to navigate and the new stuff is like day easy to see and navigate and for beginners this is even more important. So the Designer is just doing them a disservice and it should come with a disclaimer that it should be used only for proto-typing and nothing more.

Next for a simple GUI it is actually faster (once you have done one) to do it via code. Because once you have done one you have a template that you can simply copy/paste from and then tweak as needed.

Lastly I have found that designing the GUI via Code to be rather easy and fairly intuitive once you understand how to do it properly. If you have seen any of the re-write examples I have posted (I think I have posted one or more on this forum) I think you would concur.
I've used wxGlade for simple, one form apps - calculation based. For anything more complex it may seem counterintuitive but it does seem to be better to hand code. You have more control and can intervene and customize better.
Actually it is not actually counter-intuitive as the designers of pyqt did a pretty dang good job and those that created the Designer while having a good idea per-sae implemented a very bad result. I have told someone else, just because they made the tool does not mean its a good tool for that greatly depends on its implementation and with the mere fact that pyqt is designed to heavily utilize Layouts and the Designer does not render the finished code using Layouts (although it does use them for creating the version you see) means they missed the mark by miles.

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  [Kivy] Kivy Designer Module Error SARAVANAN_M 0 604 Nov-20-2019, 09:57 AM
  [PyQt] Send data between windows Pyqt5 and Qt Designer kkonrad002 8 1,275 Sep-05-2019, 02:25 PM
Last Post: Denni
  [PyQt] Qt Designer - Making a Font with a border jimmyvegas29 4 1,504 Feb-19-2019, 11:08 PM
Last Post: jimmyvegas29
  Installing PyQt5 Designer birdieman 6 42,965 Nov-01-2018, 10:51 AM
Last Post: mherrmann
  How to Integrate PyQt4 Custom Widget with Qt Designer Zukias 1 1,494 Aug-29-2018, 05:33 PM
Last Post: Zukias
  [PyQt] enter from py exported by pyqt5 designer to another py file royer14 0 805 Jun-29-2018, 01:45 AM
Last Post: royer14
  [PyQt] PyQT5: Open QFiledialog in a Dialog which was create in qt designer nieselfriem 4 11,345 Apr-30-2017, 07:40 PM
Last Post: volcano63

Forum Jump:

Users browsing this thread: 1 Guest(s)