I'm using PyQt and PyQtGraph to build a relatively simple plotting UI. As part of this I have a graphicsview (pyqtgraph's graphicslayoutwidget) that has PlotItems dynamically added to it by the user.
What I'm trying to achieve is allowing the user to select a PlotItem by double clicking on it.
It's simple enough to get if the user has double clicked somewhere within the widget window, but I can't seem to figure out how to return what was clicked on.
Most of my search results have come up with trying to reimplement mousePressEvent for certain pushbuttons. I've read a bit about event filters, but I'm not sure if that's the necessary solution here.
I'm not sure what other information might be useful for helping answer this question, so if it's unclear what I'm asking let me know so I can clarify.
Edit:
Duplicate of this:
pyqtgraph: When I click on a PlotItem how do I know which item has been clicked
One strategy is to connect to
GraphicsScene.sigMouseClicked
and then ask the scene which items are under the mouse cursor.This should get you part way there: