Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 2

Qt-interest Archive, August 2007
QGraphicsItem rotate & paint


Message 1 in thread

Hi all...

I have a problem with QGraphicsItem: it seems that if I rotate the
coordinate systems, it takes more and more time to refresh the screen...
it this normal ? viewimage is re-evaluated elsewhere and only then
needed, so the paint function need only to draw it.

 thanks a lot,

        Giampaolo

---- sample code ----

void NShapeRaster::paint(QPainter *painter, const
QStyleOptionGraphicsItem *option, QWidget *widget)

{
   int w, h;
   qreal alfa;

   alfa = getRotation();
   w = viewimage.width();
   h = viewimage.height();

   painter->rotate(alfa);  <--- rotating slow down the refresh

   painter->drawImage(-w/2, -h/2, viewimage);
}


--
 [ signature omitted ]