diff options
| author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2026-03-12 15:28:38 +0100 |
|---|---|---|
| committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2026-03-14 10:25:06 +0100 |
| commit | 11c2abdae0aa3a3001df39ef8bf818f86144e667 (patch) | |
| tree | 555e52729d08a62be29add29ada7d227ae128b2a /src/qml/jsruntime/qv4objectproto.cpp | |
| parent | b4c4bdb29ba82e646d674eb9315e1c9ddbc5e94b (diff) | |
When shutting down a Quick application that uses TreeView and
HorizontalHeaderView, the model might get destroyed before the UI does.
In that case, we'd get a runtime warning that
The 'textRole' property contains a role that doesn't exist in the model:
"display". Check your model's roleNames() implementation
This is because QQmlTreeModelToTableModel implements roleNames() to
return an empty container if there is no model, which is the case here:
the model is destroyed, the QPointer holding it becomes nullptr, and the
framework wants to store the old roles to see if anything changes when a
new model is ultimately set. QHeaderDataProxyModel::roleNames() then
ends up emitting the warning that the textRole is not found in the
model.
The logical thing to do is to return the default QAIM::roleNames() when
there is no model, as done elsewhere.
Pick-to: 6.11
Change-Id: If0a1c8bc428b00605e7c8b9d708c4551ef86dc5c
Reviewed-by: Dilek Akcay <dilek.akcay@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4objectproto.cpp')
0 files changed, 0 insertions, 0 deletions
