MousePressEvent
-
How can I store the point of a graphics view by clicking left button of a mouse and when click right button the all stored point will return..
any helping code.. -
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.