When using a QVariantAnimation with an unsigned value and it has to interpolate from a bigger to a smaller value, it will fail to do so.
The reason is _q_interpolate in qvariantanimation_p.h.
For example for unsigned, this method will be called with T=unsigned.
f ist the interpolation start and t the interpolation end. Progress is the normalized current time.
So for example for f = 100,t = 0 and progress = 0.5 the formular is:
Thats a perfect 50 with normal math. But because f and t are unsigned, so unsigned math applies. In unsigned math (0 - 100) is not -100, but (for 32 bit unsigned) 4294967196 (uint_max - 100 + 1).
|For Gerrit Dashboard: QTBUG-57925|
|235295,4||_q_interpolate<T> is unsafe with unsigned template arguments||dev||qt/qtbase||Status: ABANDONED||0||0|
|235301,3||_q_interpolate<T> is unsafe with unsigned template arguments||5.11||qt/qtbase||Status: MERGED||+2||0|