PDA

View Full Version : How can we scale the pen's width



learning_qt
28th November 2008, 09:42
I draw a line with the default pen in QGraphicsScene with the function
QGraphicsScene::addLine ( const QLineF & line, const QPen & pen = QPen() );

but when I scale this with the function: QGraphicsView::scale().
The line's length can be scale very well, but the width of the line always keeps the same.
Are there some solutions to do it?

Thanks!

ktk
29th November 2008, 11:20
I draw a line with the default pen in QGraphicsScene with the function
QGraphicsScene::addLine ( const QLineF & line, const QPen & pen = QPen() );

but when I scale this with the function: QGraphicsView::scale().
The line's length can be scale very well, but the width of the line always keeps the same.
Are there some solutions to do it?

Have you seen http://doc.trolltech.com/4.4/qpen.html#setWidth ?

Especially: Has your pen a width of 0 (i.e. is it a "cosmetic" pen) or 1?