[Development] Qt Widget Designer: Using fully qualified enumerations in .ui file properties

Friedemann Kleint Friedemann.Kleint at qt.io
Wed Nov 1 10:56:10 CET 2023


Hi,

I am planning to migrate Qt Widget Designer towards using fully 
qualified enumerations when writing .ui files in 6.7. That is, instead of

<property name="frameShape"><enum>QFrame::Box</enum></property>

it will then generate:

<property name="frameShape"><enum>QFrame::Shape::Box</enum></property>

The motivation behind this is that it should support scoped enumerations 
and this will be required at some point by Qt for Python.

For properties, uic just generates these values into C++; so it should 
mostly work transparently. There are some corner cases though where some 
checking code in uic/QtUiLoader/Designer needs to changed from

if (v == "Qt::Horizontal") to something like if 
(v.endsWith("::Horizontal"))..

These modifications are planned to trickle through to 6.5 so that tools 
embedding older versions of Qt Designer can handle it.

The question is; do you see any problems with this? Is there tooling out 
there that would trip over this? Would it be worth to make it optional?

Thanks,

Regards Friedemann

-- 
Friedemann Kleint
The Qt Company GmbH
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20231101/8bfc177d/attachment.htm>


More information about the Development mailing list