diff options
author | Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> | 2018-06-15 16:19:04 +0200 |
---|---|---|
committer | Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> | 2018-06-18 11:52:50 +0000 |
commit | 59694f8bf1c2f81c00d15fffef3060509d2a4b63 (patch) | |
tree | 01f59d33feea0da77b33efb2308d15e0beacba26 /examples/charts/callout.py | |
parent | 071fa23eaf7ced2289d3fdd789f9c8af606a4293 (diff) |
Fix examples/charts/callout
Adding null verification before drawing.
The reported artifact was related to the use of a Null QPointF.
Task-number: PYSIDE-701
Change-Id: Idcfbdf4b0bd98369a407e83404cd4fc8f1def3a0
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'examples/charts/callout.py')
-rw-r--r-- | examples/charts/callout.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/charts/callout.py b/examples/charts/callout.py index 2b2a4cbb9..4b18b6497 100644 --- a/examples/charts/callout.py +++ b/examples/charts/callout.py @@ -75,7 +75,7 @@ class Callout(QGraphicsItem): path = QPainterPath() path.addRoundedRect(self._rect, 5, 5) anchor = self.mapFromParent(self._chart.mapToPosition(self._anchor)) - if not self._rect.contains(anchor): + if not self._rect.contains(anchor) and not self._anchor.isNull(): point1 = QPointF() point2 = QPointF() @@ -131,7 +131,7 @@ class Callout(QGraphicsItem): if event.buttons() & Qt.LeftButton: self.setPos(mapToParent( event.pos() - event.buttonDownPos(Qt.LeftButton))) - event.setAccepted(Ttrue) + event.setAccepted(True) else: event.setAccepted(False) |