[PySide] image file with certain file name won't compile via pyside-rcc

Matthieu Cadet matthieu.cadet at gmail.com
Thu Mar 10 10:50:53 CET 2016

It seems that the problem come from your while block,
I get the same bug, but if you put it.next() before .fileInfo(),
it works ;)

while it.hasNext():
    info = it.fileInfo()

According to the Qt documentation "After construction, the iterator is
located before the first directory entry. Here's how to iterate over all
the entries sequentially:"

QDirIterator it("/etc", QDirIterator::Subdirectories);
 while (it.hasNext()) {
     qDebug <qthelp://com.trolltech.qt.485/qdoc/qtglobal.html#qDebug>()
<< it.next();

     // /etc/.
     // /etc/..
     // /etc/X11
     // /etc/X11/fs
     // ...

Hope this will works for you too ;)

On Thu, Mar 10, 2016 at 5:15 AM, Frank Rueter | OHUfx <frank at ohufx.com>

> Hi guys,
> 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
> --
> [image: 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> *
> _______________________________________________
> PySide mailing list
> PySide at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/pyside

Matthieu Cadet
Compositor Artist & TD,
nWave Digital
matthieu.cadet at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/pyside/attachments/20160310/6bf234b6/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ohufxLogo_50x50.png
Type: image/png
Size: 2666 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/pyside/attachments/20160310/6bf234b6/attachment.png>

More information about the PySide mailing list