From 10abd17ffb8826e4aa5861f89642c46c47b641a8 Mon Sep 17 00:00:00 2001 From: Christian Tismer Date: Sat, 3 Jul 2021 10:46:33 +0200 Subject: pathlib: support all cases which are found in the examples Wherever possible/useful, os.fspath was removed and the according pathlike modification inserted. This is still not the awaited end of the conversion, but a good step forward. Task-number: PYSIDE-1499 Pick-to: 6.1 Change-Id: I0a22ddeec06ada05dc4a97ed104d06f5f1bbf472 Reviewed-by: Friedemann Kleint --- sources/pyside6/doc/tutorials/portingguide/chapter2/bookdelegate.py | 2 +- sources/pyside6/doc/tutorials/portingguide/chapter3/bookdelegate-old.py | 2 +- sources/pyside6/doc/tutorials/qmlintegration/main.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'sources/pyside6/doc/tutorials') diff --git a/sources/pyside6/doc/tutorials/portingguide/chapter2/bookdelegate.py b/sources/pyside6/doc/tutorials/portingguide/chapter2/bookdelegate.py index bebb40f50..31acc901b 100644 --- a/sources/pyside6/doc/tutorials/portingguide/chapter2/bookdelegate.py +++ b/sources/pyside6/doc/tutorials/portingguide/chapter2/bookdelegate.py @@ -55,7 +55,7 @@ class BookDelegate(QSqlRelationalDelegate): def __init__(self, parent=None): QSqlRelationalDelegate.__init__(self, parent) star_png = Path(__file__).parent / "images" / "star.png" - self.star = QPixmap(os.fspath(star_png)) + self.star = QPixmap(star_png) def paint(self, painter, option, index): """ Paint the items in the table. diff --git a/sources/pyside6/doc/tutorials/portingguide/chapter3/bookdelegate-old.py b/sources/pyside6/doc/tutorials/portingguide/chapter3/bookdelegate-old.py index 4b5009b32..3ca6a6953 100644 --- a/sources/pyside6/doc/tutorials/portingguide/chapter3/bookdelegate-old.py +++ b/sources/pyside6/doc/tutorials/portingguide/chapter3/bookdelegate-old.py @@ -55,7 +55,7 @@ class BookDelegate(QSqlRelationalDelegate): def __init__(self, star_png, parent=None): QSqlRelationalDelegate.__init__(self, parent) star_png = Path(__file__).parent / "images" / "star.png" - self.star = QPixmap(os.fspath(star_png)) + self.star = QPixmap(star_png) def paint(self, painter, option, index): """ Paint the items in the table. diff --git a/sources/pyside6/doc/tutorials/qmlintegration/main.py b/sources/pyside6/doc/tutorials/qmlintegration/main.py index 16fbee999..5fc40ad36 100644 --- a/sources/pyside6/doc/tutorials/qmlintegration/main.py +++ b/sources/pyside6/doc/tutorials/qmlintegration/main.py @@ -106,7 +106,7 @@ if __name__ == '__main__': # Get the path of the current directory, and then add the name # of the QML file, to load it. qmlFile = Path(__file__).parent / 'view.qml' - engine.load(os.fspath(qmlFile.resolve())) + engine.load(qmlFile.resolve()) if not engine.rootObjects(): sys.exit(-1) -- cgit v1.2.3