QwtPlot::drawItems(...) using QRectF
Brought to you by:
rathmann
|
From: Pasquale T. <tri...@ps...> - 2010-02-20 08:45:13
|
Hi, I just updated to latest Qwt trunk v708, and noticed that now QwtPlot::drawItems uses QRectF instead of the old QRect. Most code compiled without need for any change, but I have some doubts: 1) in the old code, I was using, inside QwtPlot::drawItems, this line: QPixmap * pm = new QPixmap(rect.size()); But now I had to change it to something like: QPixmap * pm = new QPixmap(rect.width(),rect.height()); This pixmap is used to cache a QwtPlot rendered plot. Is this correct, or should I round up or down the size? 2) old code: painter->drawPixmap(QRect,QPixmap); new code: painter->drawPixmap(QRectF,QPixmap,QRectF); is it OK to use the QRectF like this, or should I correct the sizes somehow? 3) for some reason a plotcurve is now offset by 2 pixel too low. I'm not 100% positive this is related to the last Qwt update, but if so, how could that be? I thought it could be related to some margins, or to the fact that the QRectF has values (x,y) = (2,2), but could not figure out how to fix this. Thanks for all. If curious about the actual code, or the latest commit with the changes, here it is: http://orsa.git.sourceforge.net/git/gitweb.cgi?p=orsa/orsa;a=commitdiff;h=56f44e4a593c3369c5073b92631d2abdb7df8f83 Regards, -- Pasquale Tricarico Planetary Science Institute http://orbit.psi.edu/~tricaric |