[Issue N108897] Dangerous, subtle change to QRect::normalize()

Maks Orlovich mo85 at cornell.edu
Sun Apr 2 14:24:18 BST 2006


On Sunday 02 April 2006 08:50, Clarence Dang wrote:
> On Friday 31 March 2006 20:50, qt-bugs at trolltech.com wrote:
> > On Friday, 31. mar 2006 20:51 Clarence Dang wrote:
> > > On Friday 31 March 2006 00:06, qt-bugs at trolltech.com wrote:
> > > > On Thursday, 30. Mar 2006 18:34 Clarence Dang wrote:
> > > > > [Maybe a duplicate of
> >
> > http://www.trolltech.com/developer/tasktracker.html?method=entry&id=80908
> >
> > > > > but it's still not fixed and also "Q_ASSERT(!normRect.isValid());"
> > > > > should not have the "!" to have been a valid bug report]
> > >
> > > So N80908 is unrelated?
> >
> > It is related, granted the code snippet is dubious and the code you
> > refer to was introduced as a result of fixing 80908, which was fixed
> > for Qt 4.1.0.
>
> Actually I see now: N80908 asks for the behaviour which I claim is
> incorrect (the normalized() check).  So for that purpose, its code snippet
> is correct.

I filed #80908, because it was a regression versus Qt3.3, affecting KHTML, but 
the testcase was different; I don't recall the change any more to think of 
what else it might affect; at any rate, here is the relevant testcase:
#include <QDebug>
#include <QRect>

int main(int argc, char* argv[])
{
    QRect testRect(100, 200, 100, 0);

    QRect normRect = testRect.normalized();

    qDebug() << "Original:" << testRect <<" normalized:" << normRect;
}





More information about the kde-core-devel mailing list