[Qt-jambi-interest] Problems with QGraphicsItem::paint(...) after migration to QTJambi 4.4
Nico Naumann
nico.naumann at hpi.uni-potsdam.de
Mon Aug 11 18:10:18 CEST 2008
Hi,
Today I migrated some Java sourcecode from version 4.3 to the current
version 4.4 of QTJambi. After that, I am having trouble with the
overloaded paint methods of QGraphicsItem which doesnt pass the correct
scale factor of the item anymore.
The following code (overridden paint method of a QGraphicsItems) always
worked for me with version 4.3:
@Override
public void paint(QPainter painter, QStyleOptionGraphicsItem style,
QWidget widget) {
if( style.levelOfDetail() >= Settings.GENERAL_LOD_NEAR ) {
// paint the item
// ...
}
else
{
// do something else
}
}
After upgrading to 4.4, style.levelOfDetail() is always set to value
1.0, regardless of the scale factor of the scene. Also the matrix()
function only returns the identity matrix.
Is there any undocumented change in the API that I am not aware of? Or
is there another, maybe a better way to determine the scale factor and
to decide whether or not to draw an item?
I'd really appreaciate your help, thank you
Nico
More information about the Qt-jambi-interest
mailing list