Murray's Blog

Non-Automatic Layout is Useless / Qt Designer has bad defaults

The widgets in a UI should adapt to different window sizes, font sizes, translated text, left-to-right/right-to-left locales, etc. This is obvious to the programmers that I work with.

I recently remembered that qt-designer didn’t do this when I last tried, which shocked me. So I looked again at a newer version to see if it would make me happier. I took some side-by-side screenshots of Glade and qt-designer on my wide monitor, to make the point.

For instance, see the slideshow to experience the first-impression that a half-competent developer is likely to get. Buttons that were in the corner will be left stranded in a sea of blank space. Widgets will appear half out of the window.

All of this is unnecessary. qt-designer/qt-creator can actually do proper automatic layout if you right-click on the layout, and choose the “Lay out” -> “Lay Out in a Grid” menu item. The default is called “Lay Out in a Form Layout”. Presumably someone decided to make Visual Basic users feel at home by duplicating their stupid environment, but that just keeps them doing stupid things and makes regular developers go elsewhere.

By the way, I do like one thing in qt-designer more than Glade. It correctly assumes that a treeview is more likely than a text label to need to expand.

Note that qt-creator, which uses the same system, apparently via the same code, does the same thing. I checked the latest qt-creator snapshot.

Exit mobile version