Location of imageformats directory
I am having a problem with my imageformats directory. There are some web links that say that this should be under my program directory “program dirâ€\imageformats and other links that say that this should be un “program dirâ€\plugins\imageformats. There are others that say you can set the directory by using the addLibraryPath as shown below.
However, no matter what I do, the only way I can get my code to load the images is to have the jpeg.dll and other format conversion DLLs located at “program Directoryâ€\imageformats\*.dll . Since I can not explain this, I do not feel safe releasing this code to production. Can someone explain to me what the correct location of the files should be and why the below code does not work to force the location of the qgif4.dll, qjpeg4.dll, qmng4.dll, and other files?
Code:
int main(int argc, char *argv[])
{
QtSingleApplication a(argc, argv); // Added
if (a.isRunning()) // Added
return 0; // Added
//--------------------------------------------------
// Force location of the image loading dlls files
//--------------------------------------------------
ImagePath = Path1+"/"+"Plugins";
ImagePath = Path1+"/"+"Plugins/imageformats";
MyAppWindow w;
a.setActivationWindow(&w); // Added
//w.cmd_line_args = args;
w.show();
return a.exec();
}
Re: Location of imageformats directory
The Qt plugins deployed with your application will be found by default, no addLibraryPath() required, if you deploy them like this (Windows):
Code:
C:\Program Files\
Cool App Dir\
coolapp.exe
qtcore4.dll
qtgui4.dll
...
imageformats\
qjeg4.dll
qgif4.dll
...
sqldrivers\
qsqlite.dll
plugins\
// any plugin you have written for your program to load directly
Re: Location of imageformats directory
I also needed to add the qico4.dll to my build
so,
1.C:\Program Files\
2. Cool App Dir\
3. coolapp.exe
4. qtcore4.dll
5. qtgui4.dll
6. ...
7. imageformats\
8. qjeg4.dll
9. qico4.dll (this also needed to be added)
The above worked great for my particular build. Thanks again!!!
-masher