[PyQt] explanatory label in a not uniformly scaled QGraphicsView

Jason H scorp1us at yahoo.com
Wed Feb 9 22:22:24 GMT 2011


I don't think the items know id they are scaled or not. And if they do, that way 
madness lies (for me anyway). Rather what I think you need is an item with an 
overlay functionality. You basically have a widget (Item) stack simultaneously 
display multiple indexes. When you scale, you only scale the lower item. You 
keep the top the same. When you move it, then it will move all stacked items at 
the same time. (I am imagining something like a watermark feature) By 
subclassing QGraphicsItem, you can control what transforms are applied to the 
top (overlay) item, as well as the underlying items.






----- Original Message ----
From: Hans-Peter Jansen <hpj at urpla.net>
To: pyqt at riverbankcomputing.com
Sent: Wed, February 9, 2011 4:09:01 PM
Subject: Re: [PyQt] explanatory label in a not uniformly scaled QGraphicsView

On Wednesday 09 February 2011, 15:06:24 KONTRA, Gergely wrote:
> Hi all!
>
> Is there a way to place a text on a QGraphicsView, which always looks
> the same size (say 10px) on screen, regardless of the scaling applied
> to the View?

Gergo, this is exactly a case, where studying the Qt source is most 
helpful. Probably you can just subclass and reimplement the object of 
your liking, that doesn't apply the scaling in the paint event...

Pete
_______________________________________________
PyQt mailing list    PyQt at riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt



 
____________________________________________________________________________________
Food fight? Enjoy some healthy debate 
in the Yahoo! Answers Food & Drink Q&A.
http://answers.yahoo.com/dir/?link=list&sid=396545367


More information about the PyQt mailing list