Details
-
Epic
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.5, 6.6.0 FF
-
None
-
Do not register property setters as dependencies of the properties they set
Description
This was found when investigating a binding loop on QObject::setObjectName, but there probably are more occurrences of the same pattern. The pattern is:
if (d->extraData->objectName != name) { d->extraData->objectName.setValueBypassingBindings(name); d->extraData->objectName.notify(); // also emits a signal }
By reading objectName in the first line, we register an observer on the QProperty. This is not what we want. Rather, if we need the value, we should read it bypassing the binding:
if (d->extraData->objectName.valueBypassingBindings() != name) { d->extraData->objectName.setValueBypassingBindings(name); d->extraData->objectName.notify(); // also emits a signal }