0

i need to change rect area that mouse active on it for item(mouse click, mouse move event, ....) to polygan.
from this question Customizing shape of bounding rect we must change shape method.
but inside pg.PlotCurveItem instance (i need curve item), shape does not called !! how we can change the area to for example to polygan?!

import PySide6
from PySide6 import QtWidgets, QtGui, QtCore
import pyqtgraph as pg


class custom_curve(pg.PlotCurveItem):
    def shape(self):
        'not called '
        pass



plot = pg.plot()
line_item = custom_curve([0, 1], [1, 2])
line_item.setFlags(QtWidgets.QGraphicsItem.GraphicsItemFlag.ItemIsMovable)

plot.addItem(line_item)

pg.exec()

this is image of bounding rect that mouse active on it

and this is my desired area (only inside it active mouse event)[2]

ali
  • 53
  • 1
  • 5

0 Answers0