aboutsummaryrefslogtreecommitdiffstats
path: root/examples/charts
diff options
context:
space:
mode:
authorCristian Maureira-Fredes <cristian.maureira-fredes@qt.io>2018-06-15 16:19:04 +0200
committerCristian Maureira-Fredes <cristian.maureira-fredes@qt.io>2018-06-18 11:52:50 +0000
commit59694f8bf1c2f81c00d15fffef3060509d2a4b63 (patch)
tree01f59d33feea0da77b33efb2308d15e0beacba26 /examples/charts
parent071fa23eaf7ced2289d3fdd789f9c8af606a4293 (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')
-rw-r--r--examples/charts/callout.py4
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)