lni
24th February 2010, 10:39
Hi,
I am trying to save QGraphicsScene to an SVG file, but there is a problem on the line thickness.
In all QGraphicsItem:: paint method, I apply a scaling QTransform to the QPainter as:
MyItem::paint( QPainter* painter, ...)
{
QTransform xf;
xf.scale( 20, 20 );
painter->setTransform( xf, true ); // combine with existing transform insider painter
}
This external transform seems to case the QPen's width to be scaled, even though my QPen has width 0 (zero) with setCosmetic( true ) used.
see the screen dump. Any input is appreciated!
I am trying to save QGraphicsScene to an SVG file, but there is a problem on the line thickness.
In all QGraphicsItem:: paint method, I apply a scaling QTransform to the QPainter as:
MyItem::paint( QPainter* painter, ...)
{
QTransform xf;
xf.scale( 20, 20 );
painter->setTransform( xf, true ); // combine with existing transform insider painter
}
This external transform seems to case the QPen's width to be scaled, even though my QPen has width 0 (zero) with setCosmetic( true ) used.
see the screen dump. Any input is appreciated!