diff options
author | Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> | 2018-06-18 13:07:44 +0200 |
---|---|---|
committer | Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> | 2018-06-18 11:52:41 +0000 |
commit | 1172edc4ad8928a8b5ea7af3b0fccf8c4397b091 (patch) | |
tree | 4757d7268fc814916415f10a664f38e965ccfa14 /examples | |
parent | 3e702e0210277d4edeb3a2bb1a2cf5bfc6fbfa03 (diff) |
Fix examples/declarative/extending/chapter5
Task-number: PYSIDE-708
Change-Id: I57c2e05c02ce58a65428cd75098a85abad1bc07b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'examples')
-rw-r--r-- | examples/declarative/extending/chapter5-listproperties/listproperties.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/examples/declarative/extending/chapter5-listproperties/listproperties.py b/examples/declarative/extending/chapter5-listproperties/listproperties.py index c06e11ca0..1aec72755 100644 --- a/examples/declarative/extending/chapter5-listproperties/listproperties.py +++ b/examples/declarative/extending/chapter5-listproperties/listproperties.py @@ -51,7 +51,7 @@ from utils import text_type from PySide2.QtCore import Property, QUrl from PySide2.QtGui import QGuiApplication, QPen, QPainter, QColor from PySide2.QtQml import qmlRegisterType, ListProperty -from PySide2.QtQuick import QQuickPaintedItem, QQuickView +from PySide2.QtQuick import QQuickPaintedItem, QQuickView, QQuickItem class PieSlice (QQuickPaintedItem): def __init__(self, parent = None): @@ -84,13 +84,13 @@ 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), self._fromAngle * 16, self._angleSpan * 16); + painter.setPen(pen) + painter.setRenderHints(QPainter.Antialiasing, True) + painter.drawPie(self.boundingRect().adjusted(1,1,-1,-1), self._fromAngle * 16, self._angleSpan * 16) -class PieChart (QQuickPaintedItem): +class PieChart (QQuickItem): def __init__(self, parent = None): - QQuickPaintedItem.__init__(self, parent) + QQuickItem.__init__(self, parent) self._name = u'' self._slices = [] @@ -111,8 +111,8 @@ class PieChart (QQuickPaintedItem): if __name__ == '__main__': app = QGuiApplication(sys.argv) - qmlRegisterType(PieChart, 'Charts', 1, 0, 'PieChart'); - qmlRegisterType(PieSlice, "Charts", 1, 0, "PieSlice"); + qmlRegisterType(PieChart, 'Charts', 1, 0, 'PieChart') + qmlRegisterType(PieSlice, "Charts", 1, 0, "PieSlice") view = QQuickView() view.setResizeMode(QQuickView.SizeRootObjectToView) |