Qt-interest Archive, May 2007
MNG files inacessible when I deploy
Message 1 in thread
I use an images.qrc file that looks like this:
<RCC>
<qresource prefix="/images" >
<file>spinner.mng</file>
</qresource>
</RCC>
And I use it in my code like this:
QMovie *movie = new QMovie( ":/images/spinner.mng" );
myLabel->setMovie( movie );
It works fine as long as I am running on my development computer. When I
roll up the Qt4*.dll files and install on another machine, my mng files
stop showing up. Other png images work fine. Any idea what I am doing
wrong? Do I need to import a plugin or something? I'm using WinXP with
Qt 4.2.3, Visual Studio .NET.
Thanks!
--Dave
--
[ signature omitted ]
Message 2 in thread
Hi,
> It works fine as long as I am running on my development computer. When I
> roll up the Qt4*.dll files and install on another machine, my mng files
> stop showing up. Other png images work fine. Any idea what I am doing
> wrong? Do I need to import a plugin or something? I'm using WinXP with
> Qt 4.2.3, Visual Studio .NET.
You need to deploy Qt plugins in addition to Qt DLLs with your application.
http://doc.trolltech.com/4.2/deployment-windows.html#qt-plugins
--
[ signature omitted ]
Message 3 in thread
Dimitri wrote:
> You need to deploy Qt plugins in addition to Qt DLLs with your
> application.
> http://doc.trolltech.com/4.2/deployment-windows.html#qt-plugins
Just to be safe, I deployed all the DLL's in $QTDIR/plugins/imageformats
and made sure that their directory was contained in
QCoreApplication::libraryPaths(), but I still get empty images. I can
reproduce the problem on my dev machine with this code in main():
QApplication app(argc, argv);
app.setLibraryPaths( QStringList( app.applicationDirPath() ) );
Then, I copy qmng1.dll into my executable's directory. At run time, the
MNG images still don't show up, but they work if I leave the
applicationDirPath() as default so it uses the Qt installed plugins. Any
ideas? How can I tell at runtime which plugin DLL's Qt is trying to
load? Obviously, depend.exe doesn't work. I guess I could use ntfilemon.
Will report on this later.
--Dave
--
[ signature omitted ]
Message 4 in thread
Dave Smith wrote:
> Then, I copy qmng1.dll into my executable's directory. At run time,
> the MNG images still don't show up, but they work if I leave the
> applicationDirPath() as default so it uses the Qt installed plugins.
> Any ideas? How can I tell at runtime which plugin DLL's Qt is trying
> to load? Obviously, depend.exe doesn't work. I guess I could use
> ntfilemon. Will report on this later.
Ok, got it. The DLL's have to be in a directory called "imageformats"
since Qt will search the library path for "imageformats/qmng1.dll". It
works now. Thanks!
It'd be nice if Qt gave a warning message when a plugin DLL is missing.
Would have saved me some time chasing this issue.
--Dave
--
[ signature omitted ]