New features of Qt Designer 4.5

Published Thursday October 16th, 2008 | by

Today, I would like to take you on a tour of the features of Qt Designer in the upcoming 4.5 release. The general focus of the 4.5 release is on stability and performance. Regarding Qt Designer, we mostly worked on usability and workflow-related issues.

The widget box and the property editor now have Filter fields, which let you find properties or widgets very quickly.

Property Editor

Using Ctrl+F in the object inspector will now display a search field at the bottom, letting you perform an incremental search on the form’s widgets.

Object Inspector

Another thing to note about the object inspector is that the layout state of containers is now displayed with an icon in the left column. Broken layouts show up using the icon of the “Break Layout” action, which makes it possible to quickly check whether all container widgets have proper layouts.

The widget box now features an “Icon Mode”, in which the icons are arranged in rows. This should substantially reduce the need to scroll, especially if there are many custom widgets present.

Widget Box

Quite some work has gone into object selection. The selection modifiers now conform to standards, i.e.,Ctrl can be used to toggle the selection status of a widget. Rubber-band-selection, which was previously available only on the form itself, can now be used everywhere using the middle mouse button. A common complaint about the previous versions of Qt Designer was that selecting a layout within a nested hierarchy of layouts was difficult. As of 4.5, there will be two additional ways to achieve this: The widget context menu contains an entry “Select ancestors” which lets you select the desired ancestor widget by name. In addition, Shift-clicking a selected widget will select the next ancestor, going up the hierarchy.

Some improvements were made to layout editing. It is now possible to re-layout just by choosing another layout type without having to break the layout. Also, when breaking the layout of a container embedded into another layout, it will no longer be squeezed to zero height or width in the form editor. Instead, it will maintain its size also in the unlaid-out state, allowing for conveniently rearranging and re-layouting it. Note that this deviates from the WYSIWYG principle employed in Qt Designer; it is a temporary state that only exists in the form editor.

The form layout has an additional action “Add form layout row” in the context menu, which brings the dialog shown in the picture (also triggered by double clicking):

Form Layout “Add Row” Dialog

It let’s you specify description label and field control to be used for a row to be added very conveniently. The object names of the widget are derived from the label text as you type, no, no more lineEdit1, lineEdit2…!

One feature we are particularly proud of is “Morphing widgets”. The context menu now features a “Morph into” entry, which lists similar widget types. For example, it is possible to morph a QWidget into a QFrame or into a QGroupBox without having to break layouts, move children elsewhere, re-layout, etc.

We have not forgotten our embedded designers. Qt Designer now features an “Embedded Design” tab within its preferences dialog page, letting you define embedded device profiles. A device profile comprises screen settings like display resolution, default font and style. Designer will use these settings when editing forms.

Various other features:
- Qt Designer 4.5 now supports linear wizards based on QWizard.
- Strings now have more sub-properties, for example a “translateable” checkbox that let’s you disable the translation of a string (causing it not to show up in Qt Linguist). Also, the comment field has been split up into “disambiguation” and “comment”.
- Item widget editors have been improved, allowing you to specify more properties for the items.
- Support for QButtonGroup has been added accessible via context menu for subclasses of QAbstractButton

I hope this little tour has piqued your curiosity and you will try out one of the snapshot packages!

Did you like this? Share it:
Bookmark and Share

Posted in Uncategorized

15 comments to New features of Qt Designer 4.5

Benjamin Meyer says:

The filter is very cool and is very useful and changing layouts on the fly will be very useful.

Do you plan on improving the icons now that there is an “Icon Mode”? The line edit icon is clearly a button and which icon is the spin box vs which icon is the combo box? And there is an icon for a clock, a grid, and a clock on a grid. Which one is the calendar? Sure you might not scroll, but you will waste twice as much time hovering over each icon trying to figure out which one is the one you want.

This looks nice. The morphing in particular would be a big help.

Still, I have some questions about certain usability issues that cause me to not use Designer and either write code or hand edit the .ui file.

1) Will I be able to physically move subtrees of the object hierarchy by selecting the root in the Object Inspector? E.g., I have an container object that is zero-width in designer (because it gets filled out at run time) and I want to move it to be the third item in the parent layout instead of the second. This is very challenging currently.

2) Will the Object Inspector support moving subtrees up and down in the object hierarchy? For instance, I have a container widget W. I decide that I need add a new widget U and a new container C so that C contains W and U. E.g., I have a box with radio buttons and I want to add a second set of radio buttons.

P.S. I am still on Qt 4.2, so perhaps these have been fixed in 4.4.

Giovanni Bajo says:

IMO, filtering subwidgets would be an useful addition to the standard QWidget family. Eg: why can’t we have a filtering subwidget support (on/off by default doesn’t matter) for all QTreeWidget?

Prashanth N Udupa says:

Is is possible to provide a search box in the widget box? It can sometimes be difficult to look for widgets in the widget-box. It would be great if I can look for widgets based on class name or widget name. A search-filter like the one provided with QtAssistant Index tab would be precious.

Philippe says:

Great work, you have included in this release all the requests I have done :-) I spend much time with Designer, hence this is much appreciated.
I think the layout system could be improved, but this is another story.

Giorgio says:

Hi,
i’d like to see again a background property where i can specify an image file (as in qt 3 if i don’t get wrong) not only a palette.
You could say ok use stylesheet but it’s not exactly the same because stylesheet are not supported on osx and since
qt is good for portability it’s not very useful in this ,i suppose, common problem.

david says:

What about SQL features as found in Designer for QT3, are they on the roadmap for QT4′s designer

Michael "CSS" Howell says:

> i’d like to see again a background property where i can specify an image file (as in qt 3 if i don’t get wrong) not only a palette.
You could say ok use stylesheet but it’s not exactly the same because stylesheet are not supported on osx and since
qt is good for portability it’s not very useful in this ,i suppose, common problem.

That’s exactly what style-sheets are for, stuff like specifying backgrounds and colors. The problem is that Qt does not provide QSS support on OSX, so that needs to be fixed, instead of working around it by trying not to need style-sheets on OSX.

Giorgio says:

Michael, as you say i should find a workaround on osx, good, workaround are already there in my code, but the problem is that i don’t like workaround and specially workaround that sounds as “final solution”.

Is there any plan to provide backward compatibility in this release, i.e. a widget designed in Qt Designer v4.5 will compile with Qt v4.2.*, as long as it does not use any post-4.2 widgets? I ask because any widget designed in Qt 4.3 or 4.4 Designer uses layout features which do not exist in Qt 4.2, which means that I have to keep an install of Qt 4.2.3 on my system in order to keep my application backwards compatible, just so I can use that version of Designer to edit my widgets.

I think the problems relate to the contentsMargins methods and [horizontal|vertical]Spacing properties, having checked the documentation, as these are what were introduced into the QLayout class tree in Qt 4.3 (I’m not at my computer right now). Could some option be introduced into a project to disable the use of these features, and to revert to Qt 4.2 compatible layouts?

Is there any chance of backward compatibility being introduced into Designer, so that the layout features introduced in Qt 4.3 could not be used so that an application can be kept Qt 4.2 compatible as long as no newer widgets are used? There were some layout properties introduced in Qt 4.3, and Designer won’t let you not use them; if you lay out a form in Qt Designer 4.3 or later, it becomes dependent on Qt 4.3 or later.

The properties concerned are horizontalSpacing and verticalSpacing; they are in QGridLayout. Surely, all it would take is an option to disable the use of these properties?

Friedemann Kleint says:

Thanks for your feedback.

>Do you plan on improving the icons now that there is an ?Icon Mode?? The
>line edit icon is clearly a button and which icon is the spin box vs which
>icon is the combo box? And there is an icon for a clock, a grid, and a clock

We created new icons (should be visible in a recent package) and did our best to make them visually distinct.

>Will I be able to physically move subtrees of the object hierarchy by
>selecting the root in the Object Inspector? E.g., I have an container object
>that is zero-width in designer (because it gets filled out at run time) and
>I want to move it to be the third item in the parent layout instead of the
>second. This is very challenging currently.

We don’t think the object inspector is the right place to do that, we are leaning towards introducing a special layout editing mode (deviating from the WYSIWYG rinciple).

>Michael, as you say i should find a workaround on osx, good, workaround are already there in my code, but the problem is that i don?t like workaround and specially workaround that sounds as ?final solution?.

Stylesheets should work on OSX as of 4.5, too.

>Is there any chance of backward compatibility being introduced into
>Designer, so that the layout features introduced in Qt 4.3 could not be used
>so that an application can be kept Qt 4.2 compatible as long as no newer
>widgets are used? There were some layout properties introduced in Qt 4.3,
>and Designer won?t let you not use them; if you lay out a form in Qt
>Designer 4.3 or later, it becomes dependent on Qt 4.3 or later.

This particular issue has been addressed in the 4.4 release. If the vertical/horizontal spacings or left/top/right/bottom margins are identical respectively, they values will be saved as single values (as was the case in 4.2). Generally, we recommend using the same version of Qt Designer throughout the project, however.

jeff adams says:

Any plans to support us types in designer that have coding standards that say pointer variables must start with a “p” or “ptr” prefix?

the issue is when you name a widget, the name you give it becomes the pointer variable name you use to access methods/properties on the widget.

I’d like to name a widget something like “lastNameLineEdit” but access it via ptrLastNameLineEdit.

Please help!

Romain says:

It’s really a shame that the ui api is still not public (ui4_p.h, used by QAbstractFormLoader), as it opens a whole new world of possibilities for designer extensions and dynamically loaded forms.
I understand this was still unstable up to 4.2, but come on now this should be a stable API.
Anyway, improvements to Designer are always highly welcome :-)

Bruno Tezine says:

Excellent Job!! I was expecting someone to do this for a long time. :-) Nice UI either. Very cool!

Commenting closed.