Chapter 1. What Do You Need A GUI Designer For?

If you have some experience with GUI programming under your belt, you might ask why you should use a GUI designer in the first place. After all, you have written lots of dialogs yourself, without any help of these new-fashioned code generators, GUI builders, and what-nots. 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 at least be partially right here. If you are really good at writing dialogs by hand, know the Qt layout system in and out and are generally a good and quick code anyway, you might be just as fast if you write your dialogs yourself. But hands on your heart: You are sometimes using pencil and paper to draw a sketch of your dialog, aren't you? Then why not let the Qt Designer be your pencil and paper? You spare the expense and the trouble with a rubber and can save a few trees.

Another thing: Even if you are very good, your dialogs do not always look like you want them to when you compile and run your program for the first time. So it's back to the editor, fixing whatever needs fixing, recompile, relink, and restart. Using a good GUI builder shortens this development circle a lot, because it has a preview mode that lets you see your dialog “for real” right away, without any compiling.

Perhaps you like the general idea of a GUI builder, and you have already tried some, but felt that they were decreasing your productivity rather than increasing it. The GUI builder may have been written to support a different work or design style than yours, or it may just have been plain bad. Having an expensive-looking case or four-color ads in famous programming magazines does not necessarily mean that the tool is actually any good.

If this description fits you, I suggest you give the Qt Designer a try. It is a well-crafted tool that does not press you into any specific design style, supports all Qt widgets as well as your own and especially gets you a long way with those pesky layout managers.

There is another reason why you might want to use or even advocate the use of a GUI builder in your organization: In large organizations, there are usually different groups working on the design of the dialogs in an application and on the actual implementation. The designers know a lot about user interface design and usability issues, but not necessarily enough about programming to write at least the skeletons of the dialogs themselves. Without a GUI builder, the usual way is that the designers draw the dialogs, either on a sheet of paper or with a drawing program, and the programmers then try to implement this design as close to the draft as possible. With a GUI builder, on the other hand, the designers can just design the dialogs in the GUI builders, click on the “Generate” button (or whichever means for code generation the GUI builder provides), and the code is already written — and the programmers can concentrate on more creative jobs. Heck, if you are a programmer, you do not even need to tell the designers about the “Generate” button — just ask them to save their design, take the file, load it into the GUI builder and click that “Generate” button yourself. The designers and your boss will think that it takes you half a day to implement a dialog design, while it actually only takes you five seconds, and you can play Quake the rest of the time.

We hope that we have convinced you that it is worthwhile to make yourself familiar with the Qt Designer. To ease your first steps with this tool, we will guide you through some simple steps in next few chapters that teach you the basics of Qt Designer. Further chapters will then teach you all the ins and outs.