aboutsummaryrefslogtreecommitdiffstats
path: root/examples/declarative/extending/chapter4-customPropertyTypes/customPropertyTypes.py
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2018-07-03 14:41:11 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2018-07-03 14:51:45 +0200
commitd850748283698596327653ec30decdbd6c964af8 (patch)
tree6efc71e7877294fb616f88f1f17f089d4dce1b84 /examples/declarative/extending/chapter4-customPropertyTypes/customPropertyTypes.py
parent46ff21ee14e00b992b49562943274d62f2b5b456 (diff)
parentffae5fe2f3312fdad7ef5880308dae4fd31fec94 (diff)
Merge remote-tracking branch 'origin/5.11' into dev
Diffstat (limited to 'examples/declarative/extending/chapter4-customPropertyTypes/customPropertyTypes.py')
-rw-r--r--examples/declarative/extending/chapter4-customPropertyTypes/customPropertyTypes.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/examples/declarative/extending/chapter4-customPropertyTypes/customPropertyTypes.py b/examples/declarative/extending/chapter4-customPropertyTypes/customPropertyTypes.py
index 024efbf16..9bd9f1e78 100644
--- a/examples/declarative/extending/chapter4-customPropertyTypes/customPropertyTypes.py
+++ b/examples/declarative/extending/chapter4-customPropertyTypes/customPropertyTypes.py
@@ -51,9 +51,10 @@ from utils import text_type
from PySide2.QtCore import Property, QUrl
from PySide2.QtGui import QGuiApplication, QPen, QPainter, QColor
from PySide2.QtQml import qmlRegisterType
-from PySide2.QtQuick import QQuickPaintedItem, QQuickView
+from PySide2.QtQuick import QQuickPaintedItem, QQuickView, QQuickItem
class PieSlice (QQuickPaintedItem):
+
def __init__(self, parent = None):
QQuickPaintedItem.__init__(self, parent)
self._color = QColor()
@@ -68,14 +69,14 @@ class PieSlice (QQuickPaintedItem):
def paint(self, painter):
pen = QPen(self._color, 2)
- painter.setPen(pen);
- painter.setRenderHints(QPainter.Antialiasing, True);
- painter.drawPie(self.boundingRect().adjusted(1,1,-1,-1), 90 * 16, 290 * 16);
+ painter.setPen(pen)
+ painter.setRenderHints(QPainter.Antialiasing, True)
+ painter.drawPie(self.boundingRect().adjusted(1,1,-1,-1), 90 * 16, 290 * 16)
-class PieChart (QQuickPaintedItem):
+class PieChart (QQuickItem):
def __init__(self, parent = None):
- QQuickPaintedItem.__init__(self, parent)
- self._name = u''
+ QQuickItem.__init__(self, parent)
+ self._name = None
self._pieSlice = None
def getName(self):