Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Position of QGraphicItem in a QGraphicScene
sunil.nair last edited by
My aim is that the graphics items inside a qgraphicsview should not move when I resize the GraphicsView window.
- Currently, they seem to be in a default layout inside the graphics scene. When I resize the graphics view, the items move along with it.
- When I try to print a QGraphicitem->scenePos, the value does not change when I resize the QGraphicsView which contains the QGraphicsScene. ```
QGraphicsView *view = new QGraphicsView(this);
QGraphicsScene *scene = new QGraphicsScene();
remik last edited by
I had the same problem with items moving rightward as I stretched the window/viewport beyond the scene rect. This fixed it:
view->setAlignment( Qt::AlignLeft | Qt::AlignTop );