I have a bunch of ScatterPlotItems on a GraphicsScene and I am trying to
find a way to get the one that's underneath the the mouse cursor. This is
so that I can set that particular ScatterPlotItem as the active scatterplot
and have other mouse event functions refer to it.
graphics_scene = self.plotwidget_graph.sceneObj
graphics_scene.sigMouseHover.connect(self.set_scatter)
graphics_scene.sigMouseClicked.connect(self.check_item)
graphics_scene.sigMouseMoved.connect(self.display_item_data)
If there's only one ScatterPlotItem, all I have to do is just get the one
item in listDataItems.
def set_scatter(self, item):
plotitem = item[0]
self.active_scatter = plotitem.listDataItems()[0]
When there are more than one ScatterPlotItem though, listDataItems returns
an unsorted list of ScatterPlotItems so there's no way to tell which item
is the one that is directly underneath the mouse cursor. ScatterPlotItem
doesn't appear to have mouse event signals so I'm not sure how to proceed.
--
You received this message because you are subscribed to the Google Groups
"pyqtgraph" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/pyqtgraph/af9d2d55-1865-4d35-926d-b4046eeb6675%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.