Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.14.1
-
None
Description
When using using Package, State and ParentChange to re-parent a delegate to one of several views, the delegate, perhaps when first instantiated (??) has a null parent; if the delegate has bindings such as "width: parent.width" then an error occurs.
However parent is never null when either Component.onCompleted or onParentChanged is triggered; so it seems to be a problem with the initial state, while bindings are first evaluated, immediately after the delegate of a DelegateModel is instantiated.
NOTE: Qt's example for using Package in QtQuick 2.14 exhibits this same problem if the initial state is 'inGrid' instead of 'inList'. To demo this, copy ..../Qt/Examples/Qt-5.14.1/quick/views/package/{view.qml,Delegate.qml} and change the initial upTo value from 0 to 7 in view.qml and then run "qmlscene view.qml".
Also discussed in https://stackoverflow.com/questions/61605859/qml-delegatemodel-package-makes-delegate-have-null-parent-transiently