[Qt-interest] How to update

Sujan Dasmahapatra sdh at lmglasfiber.com
Thu Jul 2 09:55:35 CEST 2009


No Sean I need to update point[numberOfpoints] because I need those
points to save the data points in file.
And Sven Grunewaldt would Pos give me all the points on the geometry ? I
am not sure.

Kind Regards,
Sujan Dasmahapatra
-----Original Message-----
From: qt-interest-bounces at trolltech.com
[mailto:qt-interest-bounces at trolltech.com] On Behalf Of Sean Harmer
Sent: Thursday, July 02, 2009 1:12 PM
To: qt-interest at trolltech.com
Subject: Re: [Qt-interest] How to update

Hi,

On Thursday 02 Jul 2009 08:32:16 Sujan Dasmahapatra wrote:
> 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 need to update the internal position of the points. Your
custom item 
should just draw them in local item coordinates as always. The
QGraphocsView 
framework takes care of applying the transformation to your item as a
whole. 
Please have a read through the docs on QGraphicsView and coordinate
systems:

http://doc.qtsoftware.com/4.5/graphicsview.html#the-graphics-view-coordi
nate-
system

Sean

_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest




More information about the Qt-interest-old mailing list