From 20de0a3b512b040097cadeda9fdb9bfb8245117c Mon Sep 17 00:00:00 2001 From: Cristian Maureira-Fredes Date: Thu, 21 Jun 2018 13:40:02 +0200 Subject: 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 --- examples/declarative/usingmodel.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'examples/declarative/usingmodel.py') 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 -- cgit v1.2.3