[Development] Issues with QFormBuilder - All properties modified & Invalid UI

Jaroslaw Kobus Jaroslaw.Kobus at qt.io
Tue Oct 29 11:32:21 CET 2019


> And there you have it: QFormBuilder mustn't save non-STORED properties.
> If it does, it's a bug. And if we have some widget with interlinked
> properties that are not clearly marked as non-STORED, or refactored to
> be grouped together in a proper datatype, that's another bug.

Take any of QWidget's properties, e.g. sizePolicy, grep through qt sources
and search where setSizePolicy is used - QAbstractSlider::setOrientation(),
so "orientation" property of abstract slider influences "sizePolicy" - non-orthogonality detected.
If you store both properties, and then read them - the result depend on the read order.

QWidget::cursor, modified by QLineEdit::setReadOnly
QWidget::focusPolicy, modified by QGroupBox::setCheckable
...

There are really hundrets of these cases...

________________________________________
From: Development <development-bounces at qt-project.org> on behalf of Giuseppe D'Angelo via Development <development at qt-project.org>
Sent: Tuesday, October 29, 2019 11:00 AM
To: Volker Hilsheimer
Cc: development at qt-project.org
Subject: Re: [Development] Issues with QFormBuilder - All properties modified & Invalid UI

Il 29/10/19 10:55, Volker Hilsheimer ha scritto:
> But that’s why QWidget::x is read only, and why QWidget::pos is read/writeable, but flagged as “STORED false” in the metaobject (meaning that it’s just a view on some other property, not backed by its own data member).

And there you have it: QFormBuilder mustn't save non-STORED properties.
If it does, it's a bug. And if we have some widget with interlinked
properties that are not clearly marked as non-STORED, or refactored to
be grouped together in a proper datatype, that's another bug.


> Q(Abstract)FormBuilder doesn’t promise idempotence though, so extending the documentation to state that there’s no guarantee that loading the resulting .ui file will produce an identical GUI, and that the .ui file likely requires post-processing, seems to be the correct fix here.

Then I fail to see the usefulness of QFormBuilder apart from being minor
convenience, and therefore it should be overall deprecated.

My 2 c,
--
Giuseppe D'Angelo | giuseppe.dangelo at kdab.com | Senior Software Engineer
KDAB (France) S.A.S., a KDAB Group company
Tel. France +33 (0)4 90 84 08 53, http://www.kdab.com
KDAB - The Qt, C++ and OpenGL Experts



More information about the Development mailing list