[Qt-jambi-interest] constant item size uppon viewport scaling
Gunnar Sletta
gunnar at trolltech.com
Thu May 29 07:56:51 CEST 2008
On 28. mai. 2008, at 20.40, Dawid Sip wrote:
> Hi,
> as some might remember, im doing a lot with
> GraphicsView/GraphicsScene/GraphicsItem. So my recent problem is
> that I
> have EllipseItems in my scene. These ellipses are of width and
> hight-16.
> The viewport is scaled in the overriden resizeEvent of MyGraphicsView
> with fitInView, so that an Image can be displayed inside the
> MyGraphicsView entirely. This naturaly also makes the EllipseItems
> appear smaller than 16 pixel. I would like them to remain the same
> size.
> So my idea is to emmit a signal in each call to resizeEvent() of
> MyGraphicsView. This signal could be catched by the EllipseItem and
> than
> I could poly = mapToParent(this.boundingRect()) and compare the poly
> to
> some value, and scale this EllipseItem so that the size stays the
> same .
> Dont realy know how.
> Somehow I think this might be to complicated, is there an easier way?
>
Hi Dawid,
The flag you are looking for is:
http://doc.trolltech.com/qtjambi-4.3.4_01/doc/html/com/trolltech/qt/gui/QGraphicsItem.GraphicsItemFlag.html#ItemIgnoresTransformations
This tells QGraphicsView that the item should be rendered at the
position according to the scene transform, but with a transformation
according to the view.
best regards,
Gunnar
> D.
> _______________________________________________
> Qt-jambi-interest mailing list
> Qt-jambi-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-jambi-interest
http://doc.trolltech.com/qtjambi-4.3.4_01/doc/html/com/trolltech/qt/gui/QGraphicsItem.GraphicsItemFlag.html#ItemIgnoresTransformations
More information about the Qt-jambi-interest
mailing list