Details
-
Bug
-
Resolution: Done
-
P4: Low
-
4.6.2
-
None
-
Any
-
2ff6df5
Description
The default Designer property sheet (qdesigner_propertysheet.cpp) distinguishes between DynamicProperties and DefaultDynamicProperties. Both types of properties are visible in the property editor, but setting the value of DefaultDynamicProperties does not work correctly.
The attached file creates a simple custom QPushButton that will set its text according to the value of a dynamic property. The file also creates a plugin to use the widget in Designer.
Expected: Create a new form and add a DefaultDynamicPropertyTestWidget. Then change the value of the "aDynamicProperty" property in Designer's property editor. The button text should update.
Observed: The button text does not update.
The following change to qdesigner_propertysheet.cpp fixes this specific incorrect behavior:
— qdesigner_propertysheet.cpp.orig
+++ qdesigner_propertysheet.cpp
@@ -1127,7 +1127,7 @@
}
}
- if (isDynamicProperty(index)) {
+ if (isDynamicProperty(index) || isDefaultDynamicProperty(index)) {
if (d->isResourceProperty(index))
d->setResourceProperty(index, value);
if (d->isStringProperty(index))
However, I suspect that the issue is more complex than this fix: note that the initial value of the dynamic property is also incorrect.