Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Insert and remove items from QGraphicsScene/QGraphicsView
Lunarix last edited by Lunarix
I have a QGraphicsView and I draw a scene with QGraphicsScene onto it.
Now I'd like to have some object which I can place on the QGraphicsView and remove them again (for example: PushButton click)
So first click - something, let's say a image, is drawn on the QGraphicsScene and secound click it is removed again. I have to draw it in different x,y coordiantes for each click.
How do I implement this?
Thanks in advance
Eddy last edited by Eddy
You may have a look at the diagramscene example
Or did you already?
KonradMD last edited by
Did you find a solution?
You can handle it with Items like
First Button click, you can use a runtime variable or use a button with enable and disable
QGraphicLineItem = QGraphicsScene->addLine(.....);
second click would be
You can save it in a vector if you have several things to draw and remove.