Thanks, Vasilije. That link gave me most of the information I needed.
To implement, I added a pg.SignalProxy to my plot with the signal, self.plot.scene().sigMouseClicked and the slot self.mouseClicked.
In my __init__ method of the class:
self.window = pg.GraphicsWindow(...)
self.plot = self.window.addPlot(...)
self.proxyMouse = pg.SignalProxy(self.plot.scene().sigMouseClicked, slot=self.mouseClicked)
The in my mouseClicked method:
def mouseClicked(self, ev):
if ev[0].button() != 1: return
pos = ev[0].scenePos()
items = self.window.scene().items(pos, QtCore.Qt.IntersectsItemBoundingRect, QtCore.DescendingOrder)
if isinstance(items[0], QGraphicsTextItem):
widget = items[0].parentItem()
widget is now the TextItem that was clicked on. Note that the default ItemSelectionMode does not catch the object.
--
Ivan