[Qt-interest] double assignment paradox
Ian Thomson
Ian.Thomson at iongeo.com
Thu Mar 25 09:50:22 CET 2010
Egor Popov wrote:
> Hi, everyone.
>
> I have following code (here EditablePageArea and PagesInfo is my own
> classes):
>
> EditablePageArea* page = new EditablePageArea(this);
> QRectF rect = PagesInfo::getInstance()->editableAreaRect();
> qDebug() << rect; // shows QRectF(285,287 10x5)
> qDebug() << dpm(); // shows 3.77953
> qDebug() << rect.width()*dpm(); // shows 37.7953
> rect.setLeft(rect.left()*dpm());
> rect.setTop(rect.top()*dpm());
> rect.setWidth(rect.width()*dpm());
> rect.setHeight(rect.height()*dpm());
> qDebug() << rect; // show QRectF(1077.17,1084.72 -2956.22x-2996.12)
> page->setBoundingRect(rect);
> page->show();
>
> dmp() is qreal type. That happened in assignment?
>
I'm not sure what you're asking but I'm guessing you maybe meant to use
moveLeft and moveTop instead of setLeft and setTop.
Ian.
More information about the Qt-interest-old
mailing list