Priority: P1: Critical
Affects Version/s: 5.15
Fix Version/s: 5.15.1
Component/s: Quick: Core Declarative QML
Commits:ed73efa27acd8e7c42a960ef90c2e4a898c20c30 (qt/qtdeclarative/dev) 353fb2226b1a48252ff6e43d404c725f9936e0cf (qt/qtdeclarative/5.15)
- https://codereview.qt-project.org/c/qt/qtdeclarative/+/282546 resulted in some warnings being printed: https://bugreports.qt.io/browse/QTBUG-81976
- https://codereview.qt-project.org/c/qt/qtdeclarative/+/290237 was introduced to fix the warning
- https://codereview.qt-project.org/c/qt/qtdeclarative/+/291389 reverted the warning because it is a "dubious use case"
Currently, binding to the parent is not discouraged by documentation, and never has been. ListView's documentation even states what the parent of a delegate is:
Delegates are instantiated as needed and may be destroyed at any time. They are parented to ListView's contentItem, not to the view itself. State should never be stored in a delegate.
Whatever we decide on doing, we need to document it comprehensively, so that everyone is aware of the change in behaviour. As it stands now, users are going to run into a tonne of warnings in 5.15, and will have no documentation (or even a ChangeLog entry) to guide them.
- Add a ChangeLog entry somehow
- Update the "They are parented to ListView's contentItem" line in ListView's documentation
- Add a paragraph explaining that binding to parent should be avoided and why, and link to this section in the \sa of ListView's delegate documentation