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

Qt-jambi-interest Archive, November 2006
AW: QGraphicsItem parent/child with clipping


Message 1 in thread

> von Eskil A.Blomfeldt
> Cc: 'qt-jambi-interest@xxxxxxxxxxxxx'
> 
> 
> The bounding rect of the parent is in the parent's coordinate 
> system and 
> the painter is in the current item's coordinate system.

Thanks, that solved the problem.

But, now I have a new issue: whenever the scene is resized,
(say because an item was moved) the viewport changes it's
currently visible area slightly.

Is there a way to avoid it? I could set the size of the
scene to a really large value, but this seems a very dirty
way of dealing with this problem.

Best regards,
Lennart Steinke



Message 2 in thread

Lennart Steinke wrote:
>>von Eskil A.Blomfeldt
>>Cc: 'qt-jambi-interest@xxxxxxxxxxxxx'
>>
>>
>>The bounding rect of the parent is in the parent's coordinate 
>>system and 
>>the painter is in the current item's coordinate system.
> 
> 
> Thanks, that solved the problem.
> 
> But, now I have a new issue: whenever the scene is resized,
> (say because an item was moved) the viewport changes it's
> currently visible area slightly.
> 
> Is there a way to avoid it? I could set the size of the
> scene to a really large value, but this seems a very dirty
> way of dealing with this problem.

By default the view will try to view all the scene. You can avoid this 
by setting a scene rectangle:

http://doc.trolltech.com/qtjambi-1.0/com/trolltech/qt/gui/QGraphicsScene.html#setSceneRect(double,%20double,%20double,%20double)


best regards,
Gunnar