diff options
author | Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> | 2018-06-21 13:40:02 +0200 |
---|---|---|
committer | Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> | 2018-06-21 11:49:23 +0000 |
commit | 20de0a3b512b040097cadeda9fdb9bfb8245117c (patch) | |
tree | e18717ee897d7c1178fd415aaececca35c4368d4 /examples/declarative | |
parent | b2ba8304c3d4aade70a1f8e6ced6c1ba3c57b224 (diff) |
Fix examples/declarative/usingmodel
The problem was related to the recent
change on the QByteArray constructors.
The roles need to be QByteArray instead
of Python strings.
Task-number: PYSIDE-703
Change-Id: I7dfc0d2a80ae99d3c10929e9730125c68a0c5950
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'examples/declarative')
-rw-r--r-- | examples/declarative/usingmodel.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/declarative/usingmodel.py b/examples/declarative/usingmodel.py index 494647c10..4b4387117 100644 --- a/examples/declarative/usingmodel.py +++ b/examples/declarative/usingmodel.py @@ -44,9 +44,9 @@ from __future__ import print_function import os import sys -from PySide2.QtCore import QAbstractListModel, Qt, QUrl -from PySide2.QtGui import QGuiApplication import PySide2.QtQml +from PySide2.QtCore import QAbstractListModel, Qt, QUrl, QByteArray +from PySide2.QtGui import QGuiApplication from PySide2.QtQuick import QQuickView class PersonModel (QAbstractListModel): @@ -58,8 +58,8 @@ class PersonModel (QAbstractListModel): def roleNames(self): roles = { - PersonModel.MyRole : 'modelData', - Qt.DisplayRole : 'display' + PersonModel.MyRole : QByteArray(b'modelData'), + Qt.DisplayRole : QByteArray(b'display') } return roles |