diff options
author | Cristian Maureira-Fredes <[email protected]> | 2018-06-04 16:18:28 +0200 |
---|---|---|
committer | Cristian Maureira-Fredes <[email protected]> | 2018-06-05 07:10:07 +0000 |
commit | 75fbc6de0389b7220381e386740051ea0bf97e9b (patch) | |
tree | 29ebbb8e58133704e36879b15b41d4f24e6ad369 /examples/widgets/richtext/syntaxhighlighter/syntaxhighlighter.py | |
parent | d059b89abf24159205c4b7d9d59cddfd47a42a66 (diff) |
Adapt examples to proper QByteArray constructor
After correcting the QByteArray behavior, the available
constructors are constraint to bytes, bytearrays,
and others QByteArrays.
The modified lines are methods that use the modified
argument as a QByteArray (interally), that is why we now we
transform them:
"test value" -> b"test value"
Bytes are Python 2 and 3 compatible, so it does not affect
the version.
The only different change is inside `schema.py`
where a change was needed to encode a QByteArray into
utf-8.
Since this is outside our automated test, I manually test
it with Python 2.7.15 and 3.6.3 on Linux.
Task-number: PYSIDE-669
Change-Id: I8c12533b482150f4aee3d813dc127eb6b819549b
Reviewed-by: Friedemann Kleint <[email protected]>
Diffstat (limited to 'examples/widgets/richtext/syntaxhighlighter/syntaxhighlighter.py')
-rw-r--r-- | examples/widgets/richtext/syntaxhighlighter/syntaxhighlighter.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/widgets/richtext/syntaxhighlighter/syntaxhighlighter.py b/examples/widgets/richtext/syntaxhighlighter/syntaxhighlighter.py index 841943292..32adb70c7 100644 --- a/examples/widgets/richtext/syntaxhighlighter/syntaxhighlighter.py +++ b/examples/widgets/richtext/syntaxhighlighter/syntaxhighlighter.py @@ -75,7 +75,7 @@ class MainWindow(QtWidgets.QMainWindow): if fileName!="": inFile = QtCore.QFile(fileName) if inFile.open(QtCore.QFile.ReadOnly | QtCore.QFile.Text): - self.editor.setPlainText(unicode(inFile.readAll())) + self.editor.setPlainText(str(inFile.readAll())) def setupEditor(self): variableFormat = QtGui.QTextCharFormat() |