Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.12.0, 5.12.1, 5.12.2, 5.12.3
-
None
Description
I have a QListView whose model is getting items appended from a worker thread via a queued signal-slot connection. While items are being appended to the QListView, the viewport flickers. I assume a lot of (unnecessary) repaints are being done.
When I comment out the call to QListView::setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff) the listview behaves normally as expected.
Since the contents of the viewport do not change (after it is initially filled) and no scrollbar is being drawn, I would assume setting QListView::setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff) would cause less repaints.
Attached is a video showing first the behavior with a scrollbar present, then the faulty behavior without a scrollbar. Also the code used in the video is attached, it should compile with qmake -project QT+=widgets && qmake && make.
Also, please advise me any workarounds to this problem as I would like to keep my project going.
EDIT
In case it's useful, I added two callgrind files, one with flickering (without scrollbar) 'callgrind.out.2523.BAD', and one withour flickering (with scrollbar) 'callgrind.out.2561.GOOD'.