aboutsummaryrefslogtreecommitdiffstats
path: root/examples/declarative/usingmodel/usingmodel.py
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2021-04-29 10:09:33 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2021-04-29 13:21:52 +0200
commitdf43156bb35a442c4988631e1c2b0bd0fc11e618 (patch)
tree77e6c531967013e5628f04e48ba035197b8a737c /examples/declarative/usingmodel/usingmodel.py
parent130e79e4658d2438f66ab8aeb5e186349e3cb740 (diff)
Examples: Fix some space-related flake warnings
Task-number: PYSIDE-1112 Change-Id: Ib8991199e4822673d6a25cba0023dbe3b03f5938 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'examples/declarative/usingmodel/usingmodel.py')
-rw-r--r--examples/declarative/usingmodel/usingmodel.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/examples/declarative/usingmodel/usingmodel.py b/examples/declarative/usingmodel/usingmodel.py
index 7c54cc49e..4dcb8279e 100644
--- a/examples/declarative/usingmodel/usingmodel.py
+++ b/examples/declarative/usingmodel/usingmodel.py
@@ -46,17 +46,18 @@ from PySide6.QtCore import QAbstractListModel, Qt, QUrl, QByteArray
from PySide6.QtGui import QGuiApplication
from PySide6.QtQuick import QQuickView
+
class PersonModel (QAbstractListModel):
MyRole = Qt.UserRole + 1
- def __init__(self, parent = None):
+ def __init__(self, parent=None):
QAbstractListModel.__init__(self, parent)
self._data = []
def roleNames(self):
roles = {
- PersonModel.MyRole : QByteArray(b'modelData'),
- Qt.DisplayRole : QByteArray(b'display')
+ PersonModel.MyRole: QByteArray(b'modelData'),
+ Qt.DisplayRole: QByteArray(b'display')
}
return roles
@@ -75,8 +76,9 @@ class PersonModel (QAbstractListModel):
return None
def populate(self):
- self._data.append({'name':'Qt', 'myrole':'role1'})
- self._data.append({'name':'PySide', 'myrole':'role2'})
+ self._data.append({'name': 'Qt', 'myrole': 'role1'})
+ self._data.append({'name': 'PySide', 'myrole': 'role2'})
+
if __name__ == '__main__':
app = QGuiApplication(sys.argv)