[Interest] Totally broken QRect::moveRight

Thiago Macieira thiago.macieira at intel.com
Tue Dec 9 08:53:55 CET 2014


On Tuesday 09 December 2014 09:45:13 Igor Mironchik wrote:
> 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 )...

And as I replied in your bug report, there's nothing wrong with this.
-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center




More information about the Interest mailing list