Expose the `clickable` property of `PlotDataItem`. (#519)

* Fix the `clickable` property of `PlotDataItem`.

Currently if you attempt to set the `clickable` property of a PlotDataItem,
this property is silently ignored. The expected behavior is to set the
`clickable` property of the underlying PlotCurveItem.

* Use setCurvesClickable and curvesClickable instead

* curve is singular
This commit is contained in:
Christopher Mullins 2021-04-13 22:02:30 -07:00 committed by GitHub
parent 8fce6c6ad8
commit 65ef2a5a60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions

View File

@ -182,6 +182,7 @@ class PlotDataItem(GraphicsObject):
'data': None,
}
self.setCurveClickable(kargs.get('clickable', False))
self.setData(*args, **kargs)
def implements(self, interface=None):
@ -192,7 +193,13 @@ class PlotDataItem(GraphicsObject):
def name(self):
return self.opts.get('name', None)
def setCurveClickable(self, s, width=None):
self.curve.setClickable(s, width)
def curveClickable(self):
return self.curve.clickable
def boundingRect(self):
return QtCore.QRectF() ## let child items handle this