View Full Version : Q_property

12th April 2012, 18:24

I'm writing a Custom Widget for QtCreator/-Designer. Things work fine, BUT I have difficulties to create properties for the Property-
Editor. Simple properties like INTs, BOOLs, ... work fine (with Q_PROPERTY), but I would like to bundle some properties that belong together into a subproperty
like in QWidget:
| |-X
| |-Y
| |-Width
| |-Height
I've also tried to find a solution with Q_FLAGS but a so declared enum wouldn't even show up in the Property-Editor

The other point is that when I create a QString property such subproperties are created automatically (translation, ...). Does somebody know how I can get rid if them?

Any suggestions, example code, ... ?

Thanx in advance


12th April 2012, 19:40
see QDesignerCustomWidgetInterface::domXml() and its usage in the custom plugin example:

23rd April 2012, 18:51

thanks for your reply. I tried to use the domXML-function to create new properties and it works for strings. When using 'cstring' as datatyp-element I even get rid of the sub-properties translation, etc.
But I cannot create a 'set'-property. As described in http://www.kde.gr.jp/~ichi/qt/designer-manual-15.html it should be possible to create a set-property with


But if I specify this in my domXML() method this property is silently ignored by QTDesigner

Can anybody tell me where the problem is?