PDA

View Full Version : QListView smooth scrolling. Update frequency



thru
24th January 2016, 20:07
I have a QListView that on Android does not scroll smoothly.

It already has the setVerticalScrollMode(QAbstractItemView::ScrollPer Pixel. I intercept the paint event in the QItemDelegate so I can paint the items "on the fly".

The problem happens when there's too much work (time) to paint each element. If the painting is something fast as filling with color, the scrolling animation does well but if you do some more stuff it starts to act sloppy, somehow exponentially relative to the time spent painting each item.

I guess that the scrolling/animation mechanysm is sending too many painting requests synchronously. The problem is very obvious on a small device with a high pixel density.

A solution could be keeping a cache of QPixmaps for the most recent painted items but I thought I'd ask for the case there's some feature that I am missing.