[Qt-interest] Custom properties in designer

Michael Leupold lemma at confuego.org
Fri Jul 31 12:10:07 CEST 2009


Friedemann Kleint wrote:
>>Are there any plans to create an additional plugin interface to support
>>this? As I see QtPropertyBrowser is already pretty flexible in that regard
>>and most of what it would take is to allow to add extra property managers
>>and associated editor factories.
> 
> There are no plans to do this for Qt Designer. While it would be feasible
> to do this for the QtPropertyBrowser, the main problem is the
> serialization of those properties to the ui format and their handling in
> uic/uiloader.

Ah, that's something I didn't think of at first.

How about having serialization handled by some property loader objects and 
registering those objects statically, eg.
void QCustomPropertySerializer::registerSerializer(int varianttype, new 
MyPropertySerializer);

Serialization would be from/to byte array or strings. The serializer could 
be passed the raw data as well as a version string that's aved inside the 
.ui.

When used inside designer or uiloader MyPropertySerializer would be 
registered by the plugin. When used with uic the property would be 
deserialized dynamically and the client code would be responsible for 
registering the serializer (eg. by using Q_PROPERTY_SERIALIZER(MyProperty, 
MyPropertySerializer)).

Regards,
Michael




More information about the Qt-interest-old mailing list