[Qt-interest] How to update

Sujan Dasmahapatra sdh at lmglasfiber.com
Thu Jul 2 10:19:09 CEST 2009


I want those coordinates.How could I get those coordinates in point array.I want to save the data points.

Kind Regards,
Sujan Dasmahapatra

-----Original Message-----
From: Samuel Rødal [mailto:sroedal at trolltech.com] 
Sent: Thursday, July 02, 2009 1:46 PM
To: Sujan Dasmahapatra
Cc: qt-interest at trolltech.com
Subject: Re: [Qt-interest] How to update

Sujan Dasmahapatra wrote:
> Dear Friends
> 
> I have a custom GraphicsItem  Geometry class.
> 
> *Class Geometry:public  QGraphicsItem*
> 
> *{*
> 
> *                Q_OBJECT*
> 
> *Public:*
> 
> *                Int  numberOfPoints;*
> 
> *                QPointF  *points;*
> 
> *};*
> 
> * *
> 
> *Geometry *geometry = new Geometry;*
> 
> *geometry->setPos(dx+geometry->x(),dy+geometry->y());*
> 
>  
> 
>  I do a translation on the geometry by setPos() function so the position 
> of the geometry is changed.How would I update the 'points' with the new  
> coordinate points??? Please tell me someone.

You don't want to modify the points. As long as you the supplied 
QPainter to draw the points in the graphics item's paint() function, the 
painter's transform will be set up properly to match the item's position 
and transformation, and thus the points will be drawn at the correct 
coordinates.

--
Samuel





More information about the Qt-interest-old mailing list