One amazing feature of QGraphicsView
is its ability to scale itself with its scene's content (every QGraphicsItem inserted in the scene actually). The QPixmap
that I have inserted scales correctly, meaning that if I provide a scale factor of 4x4 with this:
view->scale(4,4);
Pixmap are zoomed as I want to do.
But this is not the case of the rects that I am used to drawing; they aims to surrounds the pixmaps that I draw on my scene and regardless of the scale factor, they keep a thickness of 1 instead of - I guess - 4.
I have been searching documentation about all of that stuff, trying to figure out the exact purpose of "cosmetics pen", but I still can't manage to make my rectangle go thicker.
Last notice: I have a custom QGraphicsItem
and the QPen which is used to draw the rectangled is instanciated on-the-fly in the
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
method.
Does it matter?
Thanks in advance and apologies for my lack of experience / knowledge in both the Qt framework and the drawing algorithms fields...
QPen
. – AdulteressQPen borderPen(Qt::black); borderPen.setCosmetic(false); painter->setPen(borderPen);
– Wilmoth