In my application I have two push button, namely "draw" and "stop".When the push button ("draw") is push by the user,he/she can draw or addItems in my QGraphicScene.I am using mousePressEvent to draw same position to my mouse.My addLine and addEllipse are inside my mousePressEvent. Is there a way where I can disable or enable the mousePressEvent with the push button so that If the user will push the "draw" button the mousePressEvent is enable while if the "stop" push button is press, the mousePressEvent is disable. If this is not possible, can you share any idea how can I implement and solve this problem? Thanks
Yes, you can use variable to store state of your system, for example called doDraw, assign True in draw.clicked handler and assign False in stop.clicked handler, check value of that variable in mousePressEvent and draw only if it's true.
Is it possible to disable/enable mouseEvent using a push button?