Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
I'm developing an application with QGraphicsView and QGraphicsScene. My problem is that when I scale my drawing, increasing its size, the lines get thicker and ticker, that is, it is being scaled as a raster, not vectorial. Is there a way to change that behavior? I'd like the lines kept it's original width.
My problem is that when I scale my drawing, increasing its size, the lines get thicker and ticker, that is, it is being scaled as a raster, not vectorial. Is there a way to change that behavior?
going a bit more into detail would help a lot.
What kind of drawing? How they are drawn?
It's a geographic mapping application. I Instantiate QGraphicsEllipseItem, QGraphicsLineItem, etc. and call QGraphicsScene::addItem(QGraphicsItem *item). That's enough, they get drawn.
for me it's still no clear what your issue is.
Maybe the desired behavior you want to achieve can be accomplished with a cosmetic pen?
Asperamanca last edited by
Since Qt5, Pens are non-cosmetic by default (for performance reasons, I believe). That means, their thickness gets scaled just as everything else.
If you want lines that stay constant in width, use setCosmetic(true) on the pens.
A word of warning: Anything but a width of 0 or 1 causes a huge performance hit on those.
@raven-worx Yes, you killed it. That's is the solution.
Thank you once more