Skip to content

FormLayoutAttached: Fix checks in setter of buddyFor property, add tests

ivan tkachenko requested to merge work/ratijas/6/bro into master

Previous check didn't allow setting buddy for more than once (except for marginal case of setting deeper and deeper children, which isn't well supported by positioning code anyway). Not a highly needed feature, but it better be working properly. Also the code did not perform any checks that old m_buddyFor was non-null pointer, so the whole thing only worked because internally QQuickItem::isAncestorOf does not use any of the properties of this object, and only does checked parent() calls on its argument and compares results as raw pointers. Neither did it reset back to default (attachee) object if/when buddy is dynamically destroyed, so now there are reconnects in setter, and corresponding tests with a signal spy, Repeater and Component::createObject().

CCBUG: 468712

Test plan: $2625

Edited by ivan tkachenko

Merge request reports

Loading