[Qt-jambi-interest] Problems with QGraphicsItem::paint(...) after migration to QTJambi 4.4

Gunnar Sletta gunnar at trolltech.com
Wed Aug 13 07:31:26 CEST 2008


Naumann, Nico wrote:
> thank you for your response. 
> I think that the scale factor in your scenario is correct because you
> call scale on the item itself. Since my scene contains thousands of
> QGraphicsItems, I can't call scale on each item after the view
> changes. In fact, what I do is to scale the view itself which, in
> QT4.3, resulted in scaled QGraphicsItems. Obviously this behaviour
> changed with QT4.4 since now you will see that after calling scale on
> the view, the items remain with an unchanged scale factor of 1.0. The
> question is, if this behaviour is by intention, or if it is a bug...

Hi Nico,

If I change the item.scale(2, 2) to be view.scale(2, 2). I still see the 
scale factor and the levelOfDetail is still 2. Could you be a bit more 
spesific as to what you do, or maybe change my code to reproduce the 
problem you have?

>  By the way: is there any other convenient way to scale all items of
> a scene and determine their scale factor in their paint method
> afterwards?

If you want to scale many items without having to scale the view, you 
could make your items children of a common parent and scale the parent 
item. As the transformation propegates to children, this would scale all 
items simultaneously.

best regards,
Gunnar



More information about the Qt-jambi-interest mailing list