Python Forum
Using a GUI Designer vs. hard coding
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using a GUI Designer vs. hard coding
#1
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.
Reply
#2
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.
Reply
#3
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.
Reply
#4
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.
Reply
#5
Great if the GUI is simple then it would be even faster to code up properly.
Reply
#6
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.
Reply
#7
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.
Reply
#8
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.
Reply
#9
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.
Reply
#10
Use both. Find a GUI Designer that can also generate your work into python code for you to mess around with. I use MD Python Designer (https://labdeck.com/python-designer/), its a drag and drop GUI Designer so it's simple to use but it is £15. If you don't want to pay, just use MD Python(https://labdeck.com/python/), its free, and it's got all the same GUI components and features but it limits the amount of GUI components you can use at once.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  QT Designer Krissstian 4 1,639 May-26-2022, 09:45 AM
Last Post: Krissstian
  Qt Designer : help document viewer error. davediamond 2 1,543 Apr-14-2022, 10:38 AM
Last Post: davediamond
  GUI programming PyQt 5 + Qt Designer flash77 9 2,639 Mar-19-2022, 10:31 AM
Last Post: flash77
  [PyQt] QT5 Designer Drawing greenhorn1 1 2,511 Dec-30-2021, 05:12 PM
Last Post: deanhystad
  Installed Designer - Helpf Files for "assistant" are missing Valmont 0 1,987 Mar-22-2021, 11:09 AM
Last Post: Valmont
  Attempting to use Qt Designer. thewolf 17 5,979 Feb-17-2021, 12:03 AM
Last Post: thewolf
  [PyGUI] help code python QT Designer yan_mhb 0 1,888 Aug-12-2020, 09:32 AM
Last Post: yan_mhb
  [Kivy] Kivy Designer Module Error SARAVANAN_M 0 3,836 Nov-20-2019, 09:57 AM
Last Post: SARAVANAN_M
  [PyQt] Send data between windows Pyqt5 and Qt Designer kkonrad002 8 10,041 Sep-05-2019, 02:25 PM
Last Post: Denni
  [PyQt] Qt Designer - Making a Font with a border jimmyvegas29 4 7,457 Feb-19-2019, 11:08 PM
Last Post: jimmyvegas29

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020