I wish to draw a period or dot or point in GraphicsView that:
has an arbitrary size, which works like the radius of a circle,
is affected by scaling transformations in that its position is changed according to the current scale,
but its arbitrary size is NOT affected by scaling.
The problem I'm specifically tackling is depicting celestial bodies in a solar system visualizer. I want to make things with the proper distances from each other, but space is unimaginably empty - trying to depict an Earth-sized object with a proper radius would make it very hard for the viewer to actually see anything if said user zoomed out enough to see other planets. Therefore, I would like to mark the locations with dots that don't scale in diameter, while everything else (like orbital paths, distances) scales.
I have tried to use ItemIgnoresTranformations, but that makes the object ignore both the size changes and the location changes when scale is altered. I want the object to be noticeable regardless of scale, but at the same time for it to be in its proper place.
Alternative solutions welcome.
EDIT1:
The new code looks like so:
ellipse2 = scene->addEllipse(0, 0, body.radius,body.radius,blackPen,greenBrush);
ellipse2->setFlag(QGraphicsItem::ItemIgnoresTransformations);
ellipse2->setPos(system.starX+body.getX(date2days(game.date))-body.radius/2.0,
system.starY+body.getY(date2days(game.date))-body.radius/2.0);
Previously, the position was simply put in the the place of the 0s in the addElipse() call. However, there is a problem - the planets' movements don't quite match the plotted orbital paths (I am currently simplifying to perfect circles with constant angular speed, rather than elliptical paths with variable angular speed). The actual paths seem to be shifted by some unknown (but scale-dependent) amount towards the top-left.
Here is how it looks unzoomed:
And here is how it looks zoomed:
This problem does not occur if the item is affected by transformations. What gives?