pyqtgraph: When I click on a PlotItem how do I know which item has been clicked

前端 未结 1 584
既然无缘
既然无缘 2021-01-26 13:16

I don\'t konw if my method is the right method, but it works.

class PltItem(pg.PlotItem):

    pltClicked = Signal()

    def __init__(self, parent = None):
             


        
1条回答
  •  孤街浪徒
    2021-01-26 13:44

    Your solution is a good one. Another solution is to connect to the GraphicsScene.sigMouseClicked signal and use QGraphicsScene.items() to determine whether a PlotItem (or any other item) was under the click.

    0 讨论(0)
提交回复
热议问题