Creating Dynamic Properties in a custom widget that shows in Qt Designer
-
wrote on 10 Oct 2011, 11:40 last edited by
I need to add dynamic properties that shows in Qt Designer to a custom widget at runtime.
I can create a dynamic property using
@QObject::setProperty("myDynamicProp", QVariant(1234))@
But this property does not show up in Qt DesignerIf I manually create the dynamic propety in Qt designer I can change it with
@QDesignerFormWindowInterface * formWindow = QDesignerFormWindowInterface::findFormWindow(this);
formWindow->cursor()->setWidgetProperty(this, QString("myDynamicProp"), QVariant(4321));@
But if the property does not already exist in Qt designer this fails.Any ideas how to create Dynamic Properties that shows up in Qt Designers property editor?
(I don't know what properties I need at compile time so Q_PROP.. is not an alternative.)
1/1