Chapter 26. Visual Design with Qt Designer

Why Do You Need A GUI Designer?

If you have some experience with GUI programming, you might ask why you should use a GUI designer in the first place. After all, you have written lots of dialog boxes yourself without any help from these new code generators, or GUI builders. Aren’t these things for newbies only—for people who never learned to get their hands dirty in a text editor, a real programmer’s best friend?

You might be at least partially right. If you are really good at writing dialog boxes by hand, know the Qt layout system inside and out, and are generally a good, quick coder, you might be able to write your dialog boxes yourself just as fast. But honestly, you do sometimes use pencil and paper to draw a sketch of your dialog box, don’t you? Then why not let Qt Designer be your pencil and paper? You can avoid the work and the trouble and save a few trees.

Furthermore, even if you are very good, your dialog boxes do not always look the way you want them to when you compile and run your program for the first time. So it’s back to the editor: fix whatever needs fixing and then recompile, relink, and restart. Using a good GUI builder dramatically shortens this development cycle because it has a preview mode that lets you see your dialog box “for real” right away, without any compiling.

Perhaps you like the general idea of GUI builders and have already tried some but felt that they decreased your productivity rather than increased it. The ...

Get Programming with Qt, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.