I've created a very simple QGraphicsItem (currently just draws a box) that I'd like to draw the same size each time regardless of zoom level.
What I mean is, if I add two of these items to my scene
scene->addItem(new MyCustomItem());
scene->addItem(new MyCustomItem());
scene->items()[0].setPos(-10, 0);
scene->items()[1].setPos(10, 0);
scene->addItem(new MyCustomItem());
scene->addItem(new MyCustomItem());
scene->items()[0].setPos(-10, 0);
scene->items()[1].setPos(10, 0);
To copy to clipboard, switch view to plain text mode
then start zooming in and out, obviously the item sizes will change depending on zoom level.
What I'd like to do is keep the item sizes visually the same size, for example, the box would be 10 pixels wide on the user's screen, but the zoom still has an effect, i.e. zooming in will make the items appear farther apart.
Is there an easy way to do this?
Bookmarks