Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Slow QListView update when using rather complex AbstractItemModel stack
u19809 last edited by
I have this rather complex Model stack
a - first several base item models collecting data over an IP socket (so lines get appended)
b - a set of alternative filter models that selects certain types of items of the model in a
c - a model that combines several filter models in to one (filter models can come from different base models
d - serveral Identity models which 'blacks out' certain rows of the model c
each of the models in 'd' are shown in separate QListViews.
What is the problem ?
1- when say +100K rows are collected (in total so not visualized) everything breaks down to a crawl (100% cpu and hung windows). If an set 'setUniformItemSizes' to 'false' things get worse. However if I set it to 'true' the width of the listview is not calculated propery and hence messages get truncated. To fix this i hacked a long SizeHintRole in model at level c. This shows the lines. More ideal would be that I could use 'fitToContent' but that is not supported by a listview
2. My listviews are presented horizontally split by a splitter. However no horizontal scrollbars get shown.
How can I speedup
What about the horizontal scrollbar
When getting big models, one thing that is usually done is to use a rolling window of top of your data to avoid loading everything at all time so you only keep a reduce set of data in memory and to paint.
Hope it helps.