[PyQt] Help with "stringio" ops on QTextStream in Qt5
davecortesi at gmail.com
Thu Feb 13 23:39:40 GMT 2014
I am upgrading an app from PyQt4 to PyQt5.
This app makes frequent use of in-memory i/o by
creating a QTextStream based on a QString, e.g.:
> string = QString() # must stay in scope!
> stream = QTextStream(string)
> stream << "whatever, yadda yadda"
> # in another part of the forest...
> while not stream.atEnd():
> foobar = stream.readLine()
How to make this work in the new API sans QStrings?
QTextStream(python-string-var) not unexpectedly
yields an error. Do I need to recode all this to use
Python's stringIO class, or is there a way to preserve it?
Thanks for your suggestions,
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the PyQt