Turns out I need to run it.next() first within the while block. I hadn't picked up on that in the docs for QDirIterator.

Thanks,
frank

On 10/03/16 9:06 pm, Frank Rueter | OHUfx wrote:
Hi guys, I posted this to the PySide mailing list as well as I'm getting a bit desperate, so to anybody who has already seen this: sorry for the double post!

This is with PySide 1.2.1 and Qt 4.8.5:

I have been seeing this issue for ages now and finally decided to try and fix it, however, even after writing a tiny little test case I still cannot get to the bottom of this, so I am hoping you guys can help: pyside-rc refuses to compile an image file with a certain name and I don't know why. Here is the simple test case that reproduces the issue (all required files are in the attached zip file):

I have a few icons like this:
../sandbox/resourceTest/icons/other.svg
../sandbox/resourceTest/icons/particles.svg
../sandbox/resourceTest/icons/presets.svg

I need to compile these icons into a resource module, so I have created a resource.qrc file on the same level as the "icons" directory which looks like this:
<RCC>
  <qresource>
    <file>icons/other.svg</file>
    <file>icons/particles.svg</file>
    <file>icons/presets.svg</file>
  </qresource>
</RCC>

I then compile the resource file with this command line:
pyside-rcc -o resources.py resources.qrc

To test the contents of the resource file I run the following test code ("qiteratorTest.py" in the zip):

from PySide import QtCore
import sys
import resources

it = QtCore.QDirIterator(':/icons',filter=QtCore.QDir.Files, flags=QtCore.QDirIterator.Subdirectories)
while it.hasNext():
    info = it.fileInfo()
    print '{} exists: {}'.format(info.baseName(), info.exists())
    it.next()

The result is this:

     exists: False
    presets exists: True
    other exists: True

No matter what I do, I cannot get pyside to compile the file called "particles.svg". To make matters more interesting, I duplicated the same file and renamed it to the above file names ("other.svg", "particles.svg" and "presets.svg"). But I still get the same result, so it's clearly not related to the file itself, but it's name.

I have been struggling with this problem for ages now. If anybody has any ideas, I would be very, very grateful!

Cheers,
frank


--
ohufxLogo 50x50 <http://www.ohufx.com> *vfx compositing <http://ohufx.com/index.php/vfx-compositing> | *workflow customisation and consulting <http://ohufx.com/index.php/vfx-customising>* *



_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

--
ohufxLogo 50x50 <http://www.ohufx.com> *vfx compositing <http://ohufx.com/index.php/vfx-compositing> | *workflow customisation and consulting <http://ohufx.com/index.php/vfx-customising>* *

_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to