On Monday, April 8, 2013 at 7:26 PM, Eric Johnson wrote: > Sean Fisk <sean <at> seanfisk.com (http://seanfisk.com)> writes: > > > > > OK, I have an interim solution. While I do believe that QFile.readAll() > > should > > return the file contents as a QByteArray, QResource.data() seems to work! > > Here is the code: > > > > > I tested it at home on OS X 10.8.2 using the builtin Python and Qt 4.8.1, > PySide 1.1.1 and it works once I opened the file with > test_txt.open(QtCore.QIODevice.ReadOnly | QtCore.QIODevice.Text) > > Output is: > Running PySide 1.1.1 / Qt 4.8.1 > PySide compiled with Qt 4.8.1 > Does it exist?: True > readAll(): `This is just a test. > ' > > Is there a good reason you aren't opening the file? No, there isn't! I added that to mine as well and it worked great. Having to open the file like that isn't the most intuitive interface, but I should probably read the docs a little closer too.
Thanks for the help! > > Eric > > > > > _______________________________________________ > PySide mailing list > [email protected] (mailto:[email protected]) > http://lists.qt-project.org/mailman/listinfo/pyside > >
_______________________________________________ PySide mailing list [email protected] http://lists.qt-project.org/mailman/listinfo/pyside
