<div dir="ltr"><div><div><div><div><div><div><div><div><div>I am upgrading an app from PyQt4 to PyQt5.<br>This app makes frequent use of in-memory i/o by<br></div>creating a QTextStream based on a QString, e.g.:<br><br></div>
> string = QString() # must stay in scope!<br></div>> stream = QTextStream(string)<br></div>> stream << "whatever, yadda yadda"<br></div><div>> # in another part of the forest...<br></div>> stream.seek(0)<br>
</div>> while not stream.atEnd():<br></div>> foobar = stream.readLine()<br><br></div>How to make this work in the new API sans QStrings?<br>QTextStream(python-string-var) not unexpectedly<br>yields an error. Do I need to recode all this to use<br>
Python's stringIO class, or is there a way to preserve it?<br><br>Thanks for your suggestions,<br></div><div>Dave Cortesi<br><br></div><div><div><div><div><div><div><div><div><div><br></div></div></div></div></div></div>
</div></div></div></div>