Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Not Evaluated
-
Resolution: Duplicate
-
Affects Version/s: 5.15.2
-
Fix Version/s: 5.15.2
-
Component/s: Core: Item Models, Widgets: Itemviews
-
Labels:None
-
Environment:Archlinux, gcc 10.2.0
Description
After the following change in the current 5.15 branch:
QTreeView: fetch as many nested entries as fit into the view (I54f95552) ยท Gerrit Code Review
The following example causes an endless hang:
#include <QDir> #include <QTreeView> #include <QFileSystemModel> #include <QApplication> int main(int argc, char** argv) { QApplication app{argc, argv}; QTreeView view{}; QFileSystemModel model{}; view.setModel(&model); model.setFilter(QDir::NoDot); view.show(); return app.exec(); }
It looks like the loop added in that change (cc Volker Hilsheimer Doris Verria) never terminates because fetchMore always returns 1 item?
3326 while ((count = model->rowCount(parent)) < viewCount && model->canFetchMore(parent)) (gdb) n 3327 model->fetchMore(parent); (gdb) n 3326 while ((count = model->rowCount(parent)) < viewCount && model->canFetchMore(parent)) (gdb) n 3327 model->fetchMore(parent); (gdb) n 3326 while ((count = model->rowCount(parent)) < viewCount && model->canFetchMore(parent)) (gdb) n 3327 model->fetchMore(parent); (gdb) p count $8 = 1 (gdb) p parent $9 = {r = -1, c = -1, i = 0, m = 0x0}
Not sure if this is a bug in the model (uncovered by the view change) or a bug in the views, so I added both components.
Attachments
Issue Links
- duplicates
-
QTBUG-87273 QFileSystemModel / QSFPM / QTreeView : infinite loop in latest 5.15 commits
-
- Closed
-