Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
6.8
-
None
-
7dda22389 (dev), 5e0173452 (6.8), bf714c246 (dev), 4059ea60e (6.8)
Description
In the documentation for DelegateModel::rootIndex(https://doc.qt.io/qt-6/qml-qtqml-models-delegatemodel.html#rootIndex-prop ) there is an example using the DelegateModel in combination with the QFileSystemModel. This example does not work correctly. One cannot navigate the folder structure as the rootIndex is constantly being reset.
Using a debugger I found that the rootIndex is reset by the DelegateModel in QQmlDelegateModel::handleModelReset. handleModelReset is called by QQmlDelegateModel::_q_layoutChanged if the LayoutChangeHint is not set. As QFileSystemModel::sort emits layoutChanged with default parameters this is not the case.
My proposed fix would be to change QFileSystemModel::sort to emit layoutChanged with VerticalSortHint.
Thanks in advance
Attachments
Issue Links
- relates to
-
QTBUG-33822 New SortRole needed for QFileSystemModel (and QSortFilterProxyModel)
-
- Reported
-