[Interest] Totally broken QRect::moveRight

Igor Mironchik igor.mironchik at gmail.com
Tue Dec 9 07:45:13 CET 2014


Hi guys,

I've found interesting bug in QRect in Qt 5.3.2.

Look at this code:

inline void QRect::moveRight(int pos)
{
     x1 += (pos - x2);
     x2 = pos;
}


How it can work?

QRect( 0, 0, 10, 10 ).moveRight( 10 )

produces QRect( 1, 0, 10, 10 )...

-- 
Best Regards,
Igor Mironchik.



More information about the Interest mailing list