[Qt-interest] Fixe text on a graphics view
Murphy, Sean M.
sean.murphy at gd-ais.com
Wed Sep 16 20:57:08 CEST 2009
> you could install an eventFilter and when the parent receives a
> ResizeEvent in its eventFilter function you could move the Text item.
But that doesn't fix the problem he's going to have when either
scrolling the view itself, or if he starts messing around with the zoom
levels of his view (via functions like fitInView(), scale(), shear(), or
translate().
The example I posted handles all of that, because the text is painted on
the viewport, not as part of the scene.
Sean
>>
>> I need to display a fixe text which I need to update each time the
>> mousse move on the view. I need this text to be on a corner of the
>> view, being all the time visible whenever I resize the view or scroll
>> in the view. and finaly I need this text to be unchange when I change
>> the scale of my view.
>>
>> I've create a QGraphicsItem with the flag
>> QGraphicsItem.ItemIgnoresTransformations set to True.
>>
>> On my view, I update this item in the mousseMoveEvent but how can I
>> manage to have this item in a corner whenever I change my view?
More information about the Qt-interest-old
mailing list