Results 1 to 3 of 3

Thread: Location of imageformats directory

  1. #1
    Join Date
    Nov 2011
    Posts
    30
    Qt products
    Qt3
    Platforms
    MacOS X

    Default 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?


    Qt Code:
    1. int main(int argc, char *argv[])
    2. {
    3. QString Path1,ImagePath;
    4. QtSingleApplication a(argc, argv); // Added
    5. if (a.isRunning()) // Added
    6. return 0; // Added
    7.  
    8. //--------------------------------------------------
    9. // Force location of the image loading dlls files
    10. //--------------------------------------------------
    11. Path1 = QCoreApplication::applicationDirPath();
    12.  
    13. ImagePath = Path1+"/"+"Plugins";
    14. QCoreApplication::addLibraryPath(ImagePath);
    15.  
    16. ImagePath = Path1+"/"+"Plugins/imageformats";
    17. QCoreApplication::addLibraryPath(ImagePath);
    18.  
    19.  
    20. MyAppWindow w;
    21. a.setActivationWindow(&w); // Added
    22. //w.cmd_line_args = args;
    23. w.show();
    24. return a.exec();
    25.  
    26. }
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default 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):
    Qt Code:
    1. C:\Program Files\
    2. Cool App Dir\
    3. coolapp.exe
    4. qtcore4.dll
    5. qtgui4.dll
    6. ...
    7. imageformats\
    8. qjeg4.dll
    9. qgif4.dll
    10. ...
    11. sqldrivers\
    12. qsqlite.dll
    13. plugins\
    14. // any plugin you have written for your program to load directly
    To copy to clipboard, switch view to plain text mode 

  3. The following 2 users say thank you to ChrisW67 for this useful post:

    masher (20th September 2012), ZikO (20th September 2012)

  4. #3
    Join Date
    Sep 2012
    Posts
    7
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default 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

Similar Threads

  1. 4.7.1 imageformats/qjpeg[d]4.dll unloaded
    By bmn in forum Installation and Deployment
    Replies: 2
    Last Post: 4th October 2011, 10:38
  2. Replies: 2
    Last Post: 25th March 2011, 05:19
  3. qtextbrowser and imageformats plugins
    By bred in forum Qt Quick
    Replies: 5
    Last Post: 21st December 2010, 18:54
  4. QIcon Directory Location
    By QbelcorT in forum Qt Tools
    Replies: 4
    Last Post: 28th January 2009, 02:06
  5. imageformats plugins
    By ht1 in forum Installation and Deployment
    Replies: 23
    Last Post: 10th January 2008, 20:18

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.