On Sun, 2009-12-13 at 07:59 -0800, Laurent wrote:
> Hello,
>
> I had an issue before with either py2exe or pyinstaller.
> Packing matplotlib toolbar in a single file .exe make disappear most
> of the icons on this toolbar.
>
> The issue is only seen with .svg icon file.
> .png are ok.
> (I use also pyqt)
>
> Here is dirty patch, add this to your own code:
>
> from matplotlib.backends.backend_qt4agg import NavigationToolbar2QTAgg
> as NavigationToolbar
>
> class VMToolbar(NavigationToolbar):
>
> def __init__(self, plotCanvas, parent):
> NavigationToolbar.__init__(self, plotCanvas, parent)
>
> def _icon(self, name):
> #dirty hack to use exclusively .png and thus avoid .svg usage
> #because .exe generation is problematic with .svg
> name = name.replace('.svg','.png')
> return QIcon(os.path.join(self.basedir, name))
>
> Well this is far from perfect but at least it avoid the issue if your
> are like me in a urge to release a .exe :)
The problem with svg usually is that it impliclty depends on QtXml. So,
it might be that PyInstaller doesn't bring QtXml in because it doesn't
know you are going to use the svg plugin.
Try to add an explicit "import PyQt4.QtXml" line somewhere, and svg will
start working.
--
Giovanni Bajo
Develer S.r.l.
http://www.develer.com
--
You received this message because you are subscribed to the Google Groups
"PyInstaller" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/pyinstaller?hl=en.