aboutsummaryrefslogtreecommitdiffstats
path: root/examples/declarative
diff options
context:
space:
mode:
authorVenugopal Shivashankar <Venugopal.Shivashankar@qt.io>2018-01-11 13:45:20 +0100
committerVenugopal Shivashankar <Venugopal.Shivashankar@qt.io>2018-01-17 14:48:44 +0000
commit84d46b89590c7e313aa4ab3edd9f8b0a4e913ae6 (patch)
treec702212d5549f6cca595e42e7254df21dc271694 /examples/declarative
parent108a64dd89132c10cb1fd06b6ac43677f5528783 (diff)
Example: Adjust the boundingRect for the PieChart
The extending QML tutorial examples draw PieChart that looks clipped, unless the boundingRect is adjusted. Task-number: PYSIDE-363 Change-Id: Ice4715f94ebae472d22596232ad1f22df59cea0f Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
Diffstat (limited to 'examples/declarative')
-rw-r--r--examples/declarative/extending/chapter1-basics/basics.py2
-rw-r--r--examples/declarative/extending/chapter2-methods/methods.py2
-rw-r--r--examples/declarative/extending/chapter3-bindings/bindings.py2
-rw-r--r--examples/declarative/extending/chapter4-customPropertyTypes/customPropertyTypes.py2
-rw-r--r--examples/declarative/extending/chapter5-listproperties/listproperties.py2
5 files changed, 5 insertions, 5 deletions
diff --git a/examples/declarative/extending/chapter1-basics/basics.py b/examples/declarative/extending/chapter1-basics/basics.py
index fb943bdb3..f965cade9 100644
--- a/examples/declarative/extending/chapter1-basics/basics.py
+++ b/examples/declarative/extending/chapter1-basics/basics.py
@@ -62,7 +62,7 @@ class PieChart (QQuickPaintedItem):
pen = QPen(self.color, 2)
painter.setPen(pen);
painter.setRenderHints(QPainter.Antialiasing, True);
- painter.drawPie(self.boundingRect(), 90 * 16, 290 * 16);
+ painter.drawPie(self.boundingRect().adjusted(1,1,-1,-1), 90 * 16, 290 * 16);
def getColor(self):
return self._color
diff --git a/examples/declarative/extending/chapter2-methods/methods.py b/examples/declarative/extending/chapter2-methods/methods.py
index 25543818e..d6e74f5f0 100644
--- a/examples/declarative/extending/chapter2-methods/methods.py
+++ b/examples/declarative/extending/chapter2-methods/methods.py
@@ -62,7 +62,7 @@ class PieChart (QQuickPaintedItem):
pen = QPen(self.color, 2)
painter.setPen(pen);
painter.setRenderHints(QPainter.Antialiasing, True);
- painter.drawPie(self.boundingRect(), 90 * 16, 290 * 16);
+ painter.drawPie(self.boundingRect().adjusted(1,1,-1,-1), 90 * 16, 290 * 16);
def getColor(self):
return self._color
diff --git a/examples/declarative/extending/chapter3-bindings/bindings.py b/examples/declarative/extending/chapter3-bindings/bindings.py
index 14506a061..90af6d7e1 100644
--- a/examples/declarative/extending/chapter3-bindings/bindings.py
+++ b/examples/declarative/extending/chapter3-bindings/bindings.py
@@ -63,7 +63,7 @@ class PieChart (QQuickPaintedItem):
pen = QPen(self._color, 2)
painter.setPen(pen);
painter.setRenderHints(QPainter.Antialiasing, True);
- painter.drawPie(self.boundingRect(), 90 * 16, 290 * 16);
+ painter.drawPie(self.boundingRect().adjusted(1,1,-1,-1), 90 * 16, 290 * 16);
def getColor(self):
return self._color
diff --git a/examples/declarative/extending/chapter4-customPropertyTypes/customPropertyTypes.py b/examples/declarative/extending/chapter4-customPropertyTypes/customPropertyTypes.py
index 90e6bb45c..473b7c15f 100644
--- a/examples/declarative/extending/chapter4-customPropertyTypes/customPropertyTypes.py
+++ b/examples/declarative/extending/chapter4-customPropertyTypes/customPropertyTypes.py
@@ -70,7 +70,7 @@ class PieSlice (QQuickPaintedItem):
pen = QPen(self._color, 2)
painter.setPen(pen);
painter.setRenderHints(QPainter.Antialiasing, True);
- painter.drawPie(self.boundingRect(), 90 * 16, 290 * 16);
+ painter.drawPie(self.boundingRect().adjusted(1,1,-1,-1), 90 * 16, 290 * 16);
class PieChart (QQuickPaintedItem):
def __init__(self, parent = None):
diff --git a/examples/declarative/extending/chapter5-listproperties/listproperties.py b/examples/declarative/extending/chapter5-listproperties/listproperties.py
index d6d3a73ee..b494eac0d 100644
--- a/examples/declarative/extending/chapter5-listproperties/listproperties.py
+++ b/examples/declarative/extending/chapter5-listproperties/listproperties.py
@@ -86,7 +86,7 @@ class PieSlice (QQuickPaintedItem):
pen = QPen(self._color, 2)
painter.setPen(pen);
painter.setRenderHints(QPainter.Antialiasing, True);
- painter.drawPie(self.boundingRect(), self._fromAngle * 16, self._angleSpan * 16);
+ painter.drawPie(self.boundingRect().adjusted(1,1,-1,-1), self._fromAngle * 16, self._angleSpan * 16);
class PieChart (QQuickPaintedItem):
def __init__(self, parent = None):