Repository navigation
Use QAbstractListModel for dock tabs instead of QVariant (#26009 & #29188) - #29249
Conversation
aeddc7f to
6d587f2
Compare
| } | ||
| } | ||
|
|
||
| Component.onDestruction: { root.tabsModel.clear() } |
There was a problem hiding this comment.
Why is this necessary?
There was a problem hiding this comment.
It may not be, but previously we called Component.onDestruction: { tabs.model = 0 } and I figured this was for good reason...
There was a problem hiding this comment.
@igorkorsukov It looks like you originally added it in 7d70f61. Do you by chance remember why?
Otherwise we might want to test what happens when we remove it.
There was a problem hiding this comment.
I don't remember exactly, but I can guess.
When Qml is destroyed, the Qml objects themselves can remain "alive", especially for ListView delegates, maybe because of the cache, maybe the garbage collector will just work later... But I probably needed the navigation controls to unregister themselves immediately.
This is an assumption.
from this logic, the point of this code was not to clear the model, but to clear ListView specifically, so that it would delete all its delegates.
Resolves: #26009
Resolves: #29188
See my comment in #28912 for an explainer of the problem. The changes in this PR should allow for a more granular approach where we can modify individual
contextMenuandtoolBarComponentproperties without resetting the entire tabs model.