Mouse press event for graphicsellipseitem
-
I have developed widget application with graphicsview and for graphicsview created graphicsscene and when we command send from application and receive data and need to extract range, bearing from data and converting range and bearing into X And y coordinates and plotting into graphicsview using graphicsellipseitem.
Now I am facing an issue that when I click on target I. E graphicsellipseitem I want to get info about clicked item like range, bearing.
Can you please help on this how to write mousepress event for graphicsellipseitem item and how to get info about particular target. -
@swat
As per https://doc.qt.io/qt-5/qgraphicsellipseitem-members.html,QGraphicsEllipseItem
inherits https://doc.qt.io/qt-5/qgraphicsitem.html#mousePressEvent. -
@swat said in Mouse press event for graphicsellipseitem:
how to get info about particular target.
After you implemented the
mousePressEvent
you have to decide if you check, if theQGraphicsEllipseItem
is selected (setItemIsSelectable
flag first) or if you subclass it and send a signal onmousePressEvent
(or output the item properties directly inside the event function)