[Qt-interest] Query on QGraphicsPixMapItem parent child behaviour

aviral.shukla at nokia.com aviral.shukla at nokia.com
Fri May 29 08:55:16 CEST 2009


Hi

     double x=  (this->boundingRect().width() + this->boundingRect().x())/2.0;
     double y= ( this->boundingRect().height()+ this->boundingRect().y())/2.0;
     transform.translate(x, y).rotate(rot).translate(-x, -y);

This is how I am rotating to rotate parent around it central points ...where should I code for child so that it can override when parent rotation is going ?

Thanks 
Aviral. 

>-----Original Message-----
>From: ext Oliver Demetz [mailto:olli at oliverdemetz.de] 
>Sent: Friday, May 29, 2009 12:23 PM
>To: Shukla Aviral (Nokia-D-MSW/Bangalore)
>Cc: qt-interest at trolltech.com
>Subject: Re: [Qt-interest] Query on QGraphicsPixMapItem parent 
>child behaviour
>
>Hi
>
>Both items have their own coordinate system.
>Any normal rotation is always performd around the (0,0) point 
>of the concerned coordinate system.
>
>So, by changing the position of your child item (and perhaps 
>additinally also its bounding rect) you should find your solution.
>
>Regards,
>Oliver
>
>
>aviral.shukla at nokia.com schrieb:
>> Hi
>>  
>> I have created my custom
>>  
>> Class Xitem:public QObject, public QGraphicsPixmapItem
>>  
>> And I have created two XItems (pxItem, cxItem) and am 
>rotating pxItem 
>> ...at the same time since cxItem is child of pxItem it also rotates 
>> which is desired but the Child item rotates about parent s  centre 
>> point ..which I don't want I want parent child relationship 
>so moving 
>> pxItem can move cxItem etc and both to rotate about their individual 
>> central Points.
>>  
>> Any suggestion is welcome .
>>  
>> Thanks
>> Aviral.
>>  
>>  
>>  
>> 
>> 
>> 
>----------------------------------------------------------------------
>> --
>> 
>> _______________________________________________
>> 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