MousePressEvent
General and Desktop
2
Posts
2
Posters
2.6k
Views
1
Watching
-
Well have a list of points variable in your scene most likely.
@QList<QPoint> clicked_points_;@
and in your QGraphicsScene derive "mousePressEvent":http://qt-project.org/doc/qt-4.8/qgraphicsscene.html#mousePressEvent
in it check the functions argument for button() to see which button is pressed
If left button append the "button down in screen pos":http://qt-project.org/doc/qt-4.8/qgraphicsscenemouseevent.html#buttonDownScreenPos to clicked_points_
or if right button display clicked_points_ values and clear list after that if needed
if you want to "return on right click" have a signal to emit clicked_points_, catch that in a slot and you'd be done.