Quote Originally Posted by jacek View Post
Qt tends to merge multiple paint events into one, but this might be not enough. IMO it's better to assume that you don't know when the paint even arrives and avoid changing the state in paintEvent().

Instead of a flag, you could use some variable that denotes the scroll amount. This way you don't have to care how many times and when paintEvent() was called.

Firsy of all, thanks for all your help.

But, there is a big problem if we use a flag or a scroll amount in a paintEvent(), we can not differentiate that it is call by we update(currentIndex()) or Qt Server sometimes.


one more question: Qt normally erases the widget's area before the paintEvent() call, now,
How can i disable Qt to erase the content? some times I don't want to clear the content when I call update(), like this task to scroll focus item text.