[Qt-interest] Map to view from inside QGraphicsItem::paint()

Stephen Chu stephen at ju-ju.com
Wed Oct 21 16:02:49 CEST 2009


In article <4ADC62B8.4020901 at productiveconcepts.com>,
 Josiah Bryan <jbryan at productiveconcepts.com> wrote:

> 
> In the absence of any responses, I experimented till I was cross-eyed 
> and blurry from staring at code. Finally, I came up with a workable 
> solution:
> 
>      QRect viewRect = painter->combinedTransform().mapRect(myRect);

Thanks for leaving this hit. It's really helpful to a Qt newbie like me. 
But wouldn't the width and height of viewRect be flipped if the the 
scene is rotated 90 degree?

-- 
Stephen Chu



More information about the Qt-interest-old mailing list