How to draw on Image loaded in a QGraphicsView
-
@Nico1564
Because you have a main window you can add menus, toolbars with buttons or dock widget with buttons. You can make these buttons and menus call your daw functions or what ever you want.
The sample you used is a good basis to start from. the sample that @Asperamanca has posted is also a good basis to start from. Now it is up to you to study the docs for the gui elements and do what you need to do. -
@Nico1564 said in How to draw on Image loaded in a QGraphicsView:
Yeah i know that this work but i need to draw with fonctions. I successed to do that but I don't want to have the GraphicsView at the beginning of the program, and i want to add draws like an Ellipse (and the image) when i click on buttons.
These lines could just as well happen inside a button click
QGraphicsEllipseItem* testItem = new QGraphicsEllipseItem(20,30,120,70,0); m_pScene->addItem(testItem);
In that case, you would create an ellipse every time you pressed that button.
I don't quite understand the "I don't want to have the GraphicsView at the beginning of the program" - maybe you could elaborate on that.