Yes, each item has to have a size... But this is easy if you do know the scene size.
I tried to do this with EllipseItems, but it didn't work well, and it is quite complicated. Actually I don't want the items to have a size. They should be just points without width and height. But I would like to be able to tell Qt to use a thicker pen.
Ultimately, Graphics View transforms the scene coordinates to view coordinates and draws a pixel somewhere on the screen. There should be no need to use a more complicated Item just to get a thicker point.![]()
Sure you do.
A point is a mathematical concept, you can't visualize a point. What you want is something that occupies a pixel on the screen.They should be just points without width and height.
So you want it to occupy a few pixels on the screen...But I would like to be able to tell Qt to use a thicker pen.
The whole point of graphics view is that it operates in scene coordinates instead of screen coordinates. If you don't want scene coordinates, don't use graphics view or keep the scene resolution synchronized with the view resolution (which means "no zooming"). You can't eat a cake and have a cake.Ultimately, Graphics View transforms the scene coordinates to view coordinates and draws a pixel somewhere on the screen. There should be no need to use a more complicated Item just to get a thicker point.![]()
All you need to do is to calculate how many units in world (scene) coordinates a single pixel on the screen occupies. This is an easy calculation if you know the size unit of the scene and the resolution of the view. You should know the former and Qt knows the latter - just use both pieces of information and you're done.
Bookmarks