From e4199ec3881d8e556385af98084856be857e0dbe Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 18 Sep 2024 07:36:20 +0200 Subject: type hints: Fix some typing bugs for mypy (forgiveness) The new enums still support old syntax by the forgiveness mode. Nevertheless, when using mypy to check files, strict correctness is enforced. We correct a large number of forgiveness-induced errors, but there is still a whole lot of other complaints to fix. Task-number: PYSIDE-2846 Change-Id: If566187d268ef75bc09b8d86f73d2c7d19f284f9 Reviewed-by: Friedemann Kleint --- examples/qml/tutorials/extending-qml/chapter1-basics/basics.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples/qml/tutorials/extending-qml/chapter1-basics/basics.py') diff --git a/examples/qml/tutorials/extending-qml/chapter1-basics/basics.py b/examples/qml/tutorials/extending-qml/chapter1-basics/basics.py index 9ff5fa318..d9b974b53 100644 --- a/examples/qml/tutorials/extending-qml/chapter1-basics/basics.py +++ b/examples/qml/tutorials/extending-qml/chapter1-basics/basics.py @@ -32,7 +32,7 @@ class PieChart (QQuickPaintedItem): def paint(self, painter): pen = QPen(self.color, 2) painter.setPen(pen) - painter.setRenderHints(QPainter.Antialiasing, True) + painter.setRenderHints(QPainter.RenderHint.Antialiasing, True) painter.drawPie(self.boundingRect().adjusted(1, 1, -1, -1), 90 * 16, 290 * 16) @Property(QColor, final=True) @@ -59,7 +59,7 @@ if __name__ == '__main__': view.setResizeMode(QQuickView.SizeRootObjectToView) qml_file = os.fspath(Path(__file__).resolve().parent / 'app.qml') view.setSource(QUrl.fromLocalFile(qml_file)) - if view.status() == QQuickView.Error: + if view.status() == QQuickView.Status.Error: sys.exit(-1) view.show() res = app.exec() -- cgit v1.2.3