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?
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();
}
int main(int argc, char *argv[])
{
QString Path1,ImagePath;
QtSingleApplication a(argc, argv); // Added
if (a.isRunning()) // Added
return 0; // Added
//--------------------------------------------------
// Force location of the image loading dlls files
//--------------------------------------------------
Path1 = QCoreApplication::applicationDirPath();
ImagePath = Path1+"/"+"Plugins";
QCoreApplication::addLibraryPath(ImagePath);
ImagePath = Path1+"/"+"Plugins/imageformats";
QCoreApplication::addLibraryPath(ImagePath);
MyAppWindow w;
a.setActivationWindow(&w); // Added
//w.cmd_line_args = args;
w.show();
return a.exec();
}
To copy to clipboard, switch view to plain text mode
Bookmarks