Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
item's line width also zoomed after zoom QGraphicsView
joeQ last edited by
we all know,
QGraphicsView, QGraphicsSceneis good way to show graphics item.
Scene, i add some rect items with
QGraphicsRectItem. i set the line width is 2..
matrix. i use the
matrixto zoomin and zoomout.
when i zoomed. i find the line width also zoomed when you see with your eyes. i don't want this result. i also know that set the line width 0, and the line width always is 1. this is line. but, if i fill rect.
i want to set the line width or rect area always is fixed in screen when you to see it after zoom view.
Thank u .Happy Valentine's Day
joeQ last edited by joeQ
I think i saved it.
The item also zoomed after view set matrix. because item is on the scene. the scene is not zoom.
we just zoom the view when we see the scene from eyes. it just like you to read one book with
magnifier. the line of character is also can be zoom.
so, if you don't want to this. i think the better way is to zoom the scene content not the view,
not use the matrix to zoom view.
when you want to zoomin:
- get the sceneRect, and zoomin the sceneRect's width and height, reset it to scene;
- clear all the item in scene, because, you should resize them and readd them to scene;
zoomout is same with zoomin;
zoom the content not the view.
last method was stupid.
Please to see my another post. maybe good way
KapitanPL last edited by
To all who finds this as first google result.
The answer to this question is