aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorCristian Maureira-Fredes <cristian.maureira-fredes@qt.io>2019-03-21 11:08:46 +0100
committerCristian Maureira-Fredes <cristian.maureira-fredes@qt.io>2019-03-27 15:20:36 +0000
commit77ec111ba589d507484866b1a4e1cbca1a7ade8c (patch)
treec68a496a1b0abb0024ac9c12bfa508c964a350c5 /examples
parentee9ead9f4ca85804f6cab977a0881458714aee3b (diff)
Fix classwizard example (str -> QByteArray)
Change-Id: I0c82e2d5a8fb431f55dd9d54ecaab48d8f40adb6 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'examples')
-rw-r--r--examples/widgets/dialogs/classwizard/classwizard.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/examples/widgets/dialogs/classwizard/classwizard.py b/examples/widgets/dialogs/classwizard/classwizard.py
index 52b4c679..0e0b5b3f 100644
--- a/examples/widgets/dialogs/classwizard/classwizard.py
+++ b/examples/widgets/dialogs/classwizard/classwizard.py
@@ -1,4 +1,4 @@
-
+# -*- coding: utf-8 -*-
#############################################################################
##
## Copyright (C) 2013 Riverbank Computing Limited.
@@ -41,6 +41,7 @@
#############################################################################
from PySide2 import QtCore, QtGui, QtWidgets
+from __future__ import unicode_literals
import classwizard_rc
@@ -127,7 +128,7 @@ class ClassWizard(QtWidgets.QWizard):
"Cannot write file %s:\n%s" % (headerFile.fileName(), headerFile.errorString()))
return
- headerFile.write(str(block))
+ headerFile.write(QtCore.QByteArray(block.encode("utf-8")))
block = ''
@@ -180,7 +181,7 @@ class ClassWizard(QtWidgets.QWizard):
"Cannot write file %s:\n%s" % (implementationFile.fileName(), implementationFile.errorString()))
return
- implementationFile.write(str(block))
+ implementationFile.write(QtCore.QByteArray(block.encode("utf-8")))
super(ClassWizard, self).accept()