Re-parenting Items issue

Registered by Zsombor Egri

This blueprint has been superseded. See the newer blueprint "SDK: Theme Engine Improvements" for updated plans.

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

Zoltan Balogh
Zsombor Egri
Needs approval
Zsombor Egri
Series goal:
Proposed for saucy
Milestone target:
milestone icon ubuntu-13.05
Completed by
Zoltan Balogh


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.

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.

This blueprint contains Public information 
Everyone can see this information.