subControlRect needs signal based change notifications
Clearly a better approach is needed for updating subControlRect
and reacting to those changes.
Current state of art:
If anything, KQuickStyleItem
internally should have at least no less knowledge about properties that potentially affect sub-controls, so IMHO it makes sense moving all those connections inside KQuickStyleItem
and exposing a single signal like subControlRectUpdated(string subcontrol)
or subControlRectsUpdated(list<string> subcontrols)
.
The benefits of an interned set of connections are that
- C++ connections can be more lightweight than repetitive JavaScript expressions (event if consisting of a single
computeRect()
method call) that need to be compiled one by one; - all StyleItems of the same type would share an equivalent set of connections, reducing chances to mess up in downstream QML code in controls.