aboutsummaryrefslogtreecommitdiffstats
path: root/examples/qml
diff options
context:
space:
mode:
Diffstat (limited to 'examples/qml')
-rw-r--r--examples/qml/editingmodel/model.py13
-rw-r--r--examples/qml/tutorials/extending-qml-advanced/adding/person.py1
-rw-r--r--examples/qml/tutorials/extending-qml-advanced/advanced1-Base-project/main.py3
-rw-r--r--examples/qml/tutorials/extending-qml-advanced/advanced2-Inheritance-and-coercion/main.py5
-rw-r--r--examples/qml/tutorials/extending-qml-advanced/advanced3-Default-properties/main.py4
-rw-r--r--examples/qml/tutorials/extending-qml-advanced/advanced4-Grouped-properties/main.py4
-rw-r--r--examples/qml/tutorials/extending-qml-advanced/advanced5-Attached-properties/main.py4
-rw-r--r--examples/qml/tutorials/extending-qml-advanced/advanced6-Property-value-source/main.py4
-rw-r--r--examples/qml/tutorials/extending-qml-advanced/properties/person.py1
-rw-r--r--examples/qml/tutorials/extending-qml/chapter4-customPropertyTypes/customPropertyTypes.py3
-rw-r--r--examples/qml/tutorials/extending-qml/chapter5-listproperties/listproperties.py3
11 files changed, 27 insertions, 18 deletions
diff --git a/examples/qml/editingmodel/model.py b/examples/qml/editingmodel/model.py
index 591497872..02a1e5717 100644
--- a/examples/qml/editingmodel/model.py
+++ b/examples/qml/editingmodel/model.py
@@ -2,8 +2,7 @@
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-from PySide6.QtCore import (QAbstractListModel, QByteArray, QModelIndex, Qt,
- Slot)
+from PySide6.QtCore import QAbstractListModel, QByteArray, QModelIndex, Qt, Slot
from PySide6.QtGui import QColor
from PySide6.QtQml import QmlElement
@@ -104,18 +103,18 @@ class BaseModel(QAbstractListModel):
self.beginMoveRows(QModelIndex(), sourceRow, sourceRow + count, QModelIndex(), end)
# start database work
- pops = self.db[sourceRow : sourceRow + count + 1]
+ pops = self.db[sourceRow: sourceRow + count + 1]
if sourceRow > dstChild:
self.db = (
self.db[:dstChild]
+ pops
+ self.db[dstChild:sourceRow]
- + self.db[sourceRow + count + 1 :]
+ + self.db[sourceRow + count + 1:]
)
else:
start = self.db[:sourceRow]
- middle = self.db[dstChild : dstChild + 1]
- endlist = self.db[dstChild + count + 1 :]
+ middle = self.db[dstChild: dstChild + 1]
+ endlist = self.db[dstChild + count + 1:]
self.db = start + middle + pops + endlist
# end database work
@@ -136,7 +135,7 @@ class BaseModel(QAbstractListModel):
self.beginRemoveRows(QModelIndex(), row, row + count)
# start database work
- self.db = self.db[:row] + self.db[row + count + 1 :]
+ self.db = self.db[:row] + self.db[row + count + 1:]
# end database work
self.endRemoveRows()
diff --git a/examples/qml/tutorials/extending-qml-advanced/adding/person.py b/examples/qml/tutorials/extending-qml-advanced/adding/person.py
index fafb9d581..526eae714 100644
--- a/examples/qml/tutorials/extending-qml-advanced/adding/person.py
+++ b/examples/qml/tutorials/extending-qml-advanced/adding/person.py
@@ -32,4 +32,3 @@ class Person(QObject):
@shoe_size.setter
def shoe_size(self, s):
self._shoe_size = s
-
diff --git a/examples/qml/tutorials/extending-qml-advanced/advanced1-Base-project/main.py b/examples/qml/tutorials/extending-qml-advanced/advanced1-Base-project/main.py
index dc07a2a5f..85bd91ab6 100644
--- a/examples/qml/tutorials/extending-qml-advanced/advanced1-Base-project/main.py
+++ b/examples/qml/tutorials/extending-qml-advanced/advanced1-Base-project/main.py
@@ -1,7 +1,8 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-"""PySide6 port of the qml/examples/qml/tutorials/extending-qml-advanced/advanced1-Base-project example from Qt v6.x"""
+"""PySide6 port of the
+ qml/examples/qml/tutorials/extending-qml-advanced/advanced1-Base-project example from Qt v6.x"""
from pathlib import Path
import sys
diff --git a/examples/qml/tutorials/extending-qml-advanced/advanced2-Inheritance-and-coercion/main.py b/examples/qml/tutorials/extending-qml-advanced/advanced2-Inheritance-and-coercion/main.py
index ef4b5ac5a..bb3998030 100644
--- a/examples/qml/tutorials/extending-qml-advanced/advanced2-Inheritance-and-coercion/main.py
+++ b/examples/qml/tutorials/extending-qml-advanced/advanced2-Inheritance-and-coercion/main.py
@@ -1,10 +1,11 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-"""PySide6 port of the qml/examples/qml/tutorials/extending-qml-advanced/advanced2-Inheritance-and-coercion example from Qt v6.x"""
+"""PySide6 port of the
+ qml/examples/qml/tutorials/extending-qml-advanced/advanced2-Inheritance-and-coercion example
+ from Qt v6.x"""
from pathlib import Path
-import os
import sys
from PySide6.QtCore import QCoreApplication
diff --git a/examples/qml/tutorials/extending-qml-advanced/advanced3-Default-properties/main.py b/examples/qml/tutorials/extending-qml-advanced/advanced3-Default-properties/main.py
index f469538b6..befb7978b 100644
--- a/examples/qml/tutorials/extending-qml-advanced/advanced3-Default-properties/main.py
+++ b/examples/qml/tutorials/extending-qml-advanced/advanced3-Default-properties/main.py
@@ -1,7 +1,9 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-"""PySide6 port of the qml/examples/qml/tutorials/extending-qml-advanced/default advanced3-Default-properties example from Qt v6.x"""
+"""PySide6 port of the
+ qml/examples/qml/tutorials/extending-qml-advanced/default advanced3-Default-properties example
+ from Qt v6.x"""
from pathlib import Path
import sys
diff --git a/examples/qml/tutorials/extending-qml-advanced/advanced4-Grouped-properties/main.py b/examples/qml/tutorials/extending-qml-advanced/advanced4-Grouped-properties/main.py
index 3cdddbd06..6f183e464 100644
--- a/examples/qml/tutorials/extending-qml-advanced/advanced4-Grouped-properties/main.py
+++ b/examples/qml/tutorials/extending-qml-advanced/advanced4-Grouped-properties/main.py
@@ -1,7 +1,9 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-"""PySide6 port of the qml/examples/qml/tutorials/extending-qml-advanced/advanced4-Grouped-properties example from Qt v6.x"""
+"""PySide6 port of the
+ qml/examples/qml/tutorials/extending-qml-advanced/advanced4-Grouped-properties example
+ from Qt v6.x"""
from pathlib import Path
import sys
diff --git a/examples/qml/tutorials/extending-qml-advanced/advanced5-Attached-properties/main.py b/examples/qml/tutorials/extending-qml-advanced/advanced5-Attached-properties/main.py
index bb607ac76..27f648642 100644
--- a/examples/qml/tutorials/extending-qml-advanced/advanced5-Attached-properties/main.py
+++ b/examples/qml/tutorials/extending-qml-advanced/advanced5-Attached-properties/main.py
@@ -1,7 +1,9 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-"""PySide6 port of the qml/examples/qml/tutorials/extending-qml-advanced/advanced5-Attached-properties example from Qt v6.x"""
+"""PySide6 port of the
+ qml/examples/qml/tutorials/extending-qml-advanced/advanced5-Attached-properties example
+ from Qt v6.x"""
from pathlib import Path
import sys
diff --git a/examples/qml/tutorials/extending-qml-advanced/advanced6-Property-value-source/main.py b/examples/qml/tutorials/extending-qml-advanced/advanced6-Property-value-source/main.py
index b763a456a..d33f1e1fb 100644
--- a/examples/qml/tutorials/extending-qml-advanced/advanced6-Property-value-source/main.py
+++ b/examples/qml/tutorials/extending-qml-advanced/advanced6-Property-value-source/main.py
@@ -1,7 +1,9 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-"""PySide6 port of the qml/examples/qml/tutorials/extending-qml-advanced/advanced6-Property-value-source example from Qt v6.x"""
+"""PySide6 port of the
+ qml/examples/qml/tutorials/extending-qml-advanced/advanced6-Property-value-source example
+ from Qt v6.x"""
from pathlib import Path
import sys
diff --git a/examples/qml/tutorials/extending-qml-advanced/properties/person.py b/examples/qml/tutorials/extending-qml-advanced/properties/person.py
index fafb9d581..526eae714 100644
--- a/examples/qml/tutorials/extending-qml-advanced/properties/person.py
+++ b/examples/qml/tutorials/extending-qml-advanced/properties/person.py
@@ -32,4 +32,3 @@ class Person(QObject):
@shoe_size.setter
def shoe_size(self, s):
self._shoe_size = s
-
diff --git a/examples/qml/tutorials/extending-qml/chapter4-customPropertyTypes/customPropertyTypes.py b/examples/qml/tutorials/extending-qml/chapter4-customPropertyTypes/customPropertyTypes.py
index c70d7fc42..659850f38 100644
--- a/examples/qml/tutorials/extending-qml/chapter4-customPropertyTypes/customPropertyTypes.py
+++ b/examples/qml/tutorials/extending-qml/chapter4-customPropertyTypes/customPropertyTypes.py
@@ -1,7 +1,8 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-"""PySide6 port of the qml/tutorials/extending-qml/chapter4-customPropertyTypes example from Qt v5.x"""
+"""PySide6 port of the qml/tutorials/extending-qml/chapter4-customPropertyTypes example
+ from Qt v5.x"""
import os
from pathlib import Path
diff --git a/examples/qml/tutorials/extending-qml/chapter5-listproperties/listproperties.py b/examples/qml/tutorials/extending-qml/chapter5-listproperties/listproperties.py
index 236c487f9..98952cef1 100644
--- a/examples/qml/tutorials/extending-qml/chapter5-listproperties/listproperties.py
+++ b/examples/qml/tutorials/extending-qml/chapter5-listproperties/listproperties.py
@@ -54,7 +54,8 @@ class PieSlice (QQuickPaintedItem):
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.drawPie(
+ self.boundingRect().adjusted(1, 1, -1, -1), self._fromAngle * 16, self._angleSpan * 16)
@QmlElement