That's good to know, Eric. Eventually we will be doing Windows distribution so I'm glad there are no problems.

Here is another update. I tried putting Lena on a button using QIcon on my OS X installation and it worked:
That leads me to believe it's a problem with QFile, not the actual generated resource file. I'm going to try messing around with the QResource class next.

Thanks for all the help, guys!

Sincerely,

-- 
Sean Fisk

On Monday, April 8, 2013 at 3:18 PM, Eric Johnson wrote:

Sean Fisk <sean <at> seanfisk.com> writes:

Thanks for the confirmation with Python 2 and 3 on Ubuntu. Although we
don't yet know whether it is a bug or just incorrect code by me.

Works fine for me on Windows (cygwin/bash shell but win32 version of
Python 2.7.2) if I open the file first.

I'm surprised there is no exception thrown if you don't do this.
I can try on OS X tonight.

...
# Read resource
test_txt = QtCore.QFile(':/test.txt')
test_txt.open(QtCore.QIODevice.ReadOnly | QtCore.QIODevice.Text)
print 'Does it exist?: {0}'.format(test_txt.exists())
print "readAll(): `{0}'".format(test_txt.readAll())

gives output

$ python test.py
Running PySide 1.1.0 / Qt 4.7.4
PySide compiled with Qt 4.7.4
Does it exist?: True
readAll(): `This is just a test.
'

Eric



_______________________________________________
PySide mailing list

_______________________________________________
PySide mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/pyside

Reply via email to