From 59694f8bf1c2f81c00d15fffef3060509d2a4b63 Mon Sep 17 00:00:00 2001 From: Cristian Maureira-Fredes Date: Fri, 15 Jun 2018 16:19:04 +0200 Subject: 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 --- examples/charts/callout.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples') 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) -- cgit v1.2.3