Re-parenting Items issue
Re-parenting items is not always applied on styling. This happens when the styled item's parent is not styled or when the delegate (e.g in ListView's delegate) parent is not notified.
Blueprint information
- Status:
- Complete
- Approver:
- Zoltan Balogh
- Priority:
- Undefined
- Drafter:
- Zsombor Egri
- Direction:
- Needs approval
- Assignee:
- Zsombor Egri
- Definition:
- Superseded
- Series goal:
- Proposed for saucy
- Implementation:
- Unknown
- Milestone target:
- ubuntu-13.05
- Started by
- Completed by
- Zoltan Balogh
Related branches
Related bugs
Bug #1081038: ItemStyle.path is (null) on start, gets reevaluated on theme change | Fix Released |
Sprints
Whiteboard
This happens when a non-styled item is reparented (when items under a Repeater, positioner, or a delegate are styled), therefore the need of re-evaluating styling is not detected. When the theme is changed (or theme change is detected) the item hierarchy is already set, therefore the styling will be properly done. Another problem is that currently the style is applied only on one level of child items. If none of those are styled, broadcasting the re-styling downwards in the hierarchy is stopped.
Solutions:
1. We connect all the parents' changes between two styled items to the underlying one so we get notification about changes of those parents. We also need to link the ItemStyleAttached objects so we can apply proper styling.
2. We extend each QML element grabbing parent property. This operation requires using all QtQuick privates, and some of those force us to link with the QtQuick plugins (i.e. positioners like QQuickColumn, QQuickRow, etc). If we succeed in this, we can detect parent changes in every item, therefore we can detect eventual style changes too.
3. Introduce a "bridge" styling, which would be used on those items we don't style, and help us on detecting parent changes. This helps us linking the styled items in between them so the style appliance is easier. However, it is pretty annoying to put styling information on those elements where we don't even style. Therefore this solution is not really recommended.
Work Items
Work items:
Investigate possibility of extending all QML types: DONE
Prototype bridge solution: DONE
Prototype connecting non-styled parents: DONE
Connect non-styled parent's parentChanged() signals: TODO
Dependency tree
* Blueprints in grey have been implemented.