Results 1 to 16 of 16

Thread: why do icons only show up on my computer ??

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2012
    Posts
    7
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: why do icons only show up on my computer ??

    I need to make a correction to my previous statement...

    Static declarations are detected in Dependency Walker when you drag yourExecutable.exe and place it in the Dependency Walker's main window. However, what I learned yesterday is that Dependency walker will find dynamic dependencies also.

    Dynamic dependencies are found by running a Static detection and then using the "Profile" pulldown menu and selecting "Start Profiling".

    This will show you everytime that your executable called upon qtcore4.dll AND what qtcore4 called, that is how I confirmed that I also needed to add the qico4.dll as well as the qjpeg4.dll to my VS setup project. This will actually execute your app in the process. It is a very cool feature of Dependency Walker of which I was unaware.

    Anyway, because I did not know that I could use Dependency Walker to find Dynamic Dependencies; I incorrectly stated that I did not know what dependencies I was missing. I hope this helps.

    This forum, or more accurately the Members of this forum have been very helpful!

    Thanks;
    masher
    PS: If your app is 32bit then you must use the 32bit version of Dependency Walker, or 64bit for a 64bit app. The Dynamic feature will not work otherwise.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: why do icons only show up on my computer ??

    Quote Originally Posted by masher View Post
    Dynamic dependencies are found by running a Static detection and then using the "Profile" pulldown menu and selecting "Start Profiling".

    This will show you everytime that your executable called upon qtcore4.dll AND what qtcore4 called, that is how I confirmed that I also needed to add the qico4.dll as well as the qjpeg4.dll to my VS setup project. This will actually execute your app in the process. It is a very cool feature of Dependency Walker of which I was unaware.
    I think it works the other way -- dependency walker checks which libraries are loaded by your application, not which are required by your application. To test it, add a couple of completely unrelated dll files into imageplugins directory and run the test. You'll probably see them being loaded, however they are not dependencies of your program -- it would work exactly the same way without them. Moreover, your program may not be using any JPEG files but qjpeg4.dll will still get loaded and "seen" by dependency walker, however, again, it is not a dependency of your app.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. The following user says thank you to wysota for this useful post:

    masher (21st September 2012)

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

    Default Re: why do icons only show up on my computer ??

    Quote Originally Posted by wysota View Post
    I think it works the other way -- dependency walker checks which libraries are loaded by your application, not which are required by your application. To test it, add a couple of completely unrelated dll files into imageplugins directory and run the test. You'll probably see them being loaded, however they are not dependencies of your program -- it would work exactly the same way without them. Moreover, your program may not be using any JPEG files but qjpeg4.dll will still get loaded and "seen" by dependency walker, however, again, it is not a dependency of your app.

    I am going to have to respectfully disagree. qjpeg4.dll is dynamically called because it is needed by qtcore4.dll, which my app calls to show the .jpeg and the .ico files. If I build the .msi with qjpeg4.dll and qico4.dll removed the custom icons and the .jpgs are missing from the Qt windows.

    Kindly;
    Michael
    Last edited by masher; 20th September 2012 at 21:10. Reason: corrected .dll callouts

  5. #4
    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: why do icons only show up on my computer ??

    I don't think you are disagreeing, just confusing required with available (and loading DLLs with ultimate use of the DLL). If your application requires JPEG image handling then it requires qjpeg4.dll, no doubt. However, when Qt needs to load an image it loads all the available image format plugins (QImageIOPlugin) it can find and then asks each (QImageIOPlugin::capabilities()) whether the particular image can be handled by the plugin. It will then use the JPEG plugin in this case. (If no plugin can handle the image then built-in options are tried before failing) All of the available plugins are loaded and show in DW during a run profile.

    This code:
    Qt Code:
    1. #include <QtGui>
    2.  
    3. int main(int argc, char **argv)
    4. {
    5. QApplication app(argc, argv);
    6. QLabel l;
    7. l.setPixmap(QPixmap("Lenna.png"));
    8. l.show();
    9. return app.exec();
    10. }
    To copy to clipboard, switch view to plain text mode 
    makes no use of JPEG, GIF etc. but because they are available DW shows:
    WinXPDev.png

    You only need to ship the plugins your applications requires but no particular harm comes from shipping them all.

  6. The following user says thank you to ChrisW67 for this useful post:

    masher (21st September 2012)

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

    Default Re: why do icons only show up on my computer ??

    I just ran Dependency Walker (DW) again and Profiled my .exe. It did not load any other imageformats, only the ones that it needed, which in my case is ONLY qjpeg4.dll and qico4.dll. It did not load qtiff4.dll, or qsvg4.dll, or qmng4.dll, or qgif4.dll, or qtga4.dll. It only loaded those .dll's that it depends upon.

    So, ChrisW67 & wysota, if I understand you correctly, you are saying, 'If you include ALL of the imageformat plugins into the .msi then ALL of them will be loaded at runtime, even if they are not needed.'? Okay, that helps clarify how QT works. Is that true in general for QT, or only for the (absolute ref'ed .dll) calls from qcore4.dll?

    However, going back to the initial reason for the thread.
    Re: why do icons only show up on my computer ??
    I think you will agree when I say. Obviously, I did not include the entire plugins directory in my setup project (.msi) and after I learned how to make better use of DW, it worked very well in determining which .dll's were missing from the .exe even the .dll's that were called only at runtime.

    Thanks you for really getting to the heart of the matter even though it may have been tempting to give up...

    Thanks again;
    masher

  8. #6
    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: why do icons only show up on my computer ??

    Is that true in general for QT, or only for the (absolute ref'ed .dll) calls from qcore4.dll?
    Other parts of Qt, for instance SQL support, load plugins on demand and check all the relevant plugins to see which, if any, supports the demand. Plugins provide a mechanism to extend the library without the library having to know about every possibility ahead of time. All the library knows ahead of time is the defined interfaces that a plugin must implement. It is a common idiom for extension.

  9. The following user says thank you to ChrisW67 for this useful post:

    masher (21st September 2012)

Similar Threads

  1. Show Icons in Header of QTreeView
    By blackbubblegum in forum Qt Programming
    Replies: 2
    Last Post: 11th February 2012, 00:55
  2. QMenu does not show icons from QAction
    By eumel1990 in forum Newbie
    Replies: 5
    Last Post: 10th September 2011, 10:57
  3. How to show images from database as icons in QListView
    By LeshaS in forum Qt Programming
    Replies: 2
    Last Post: 21st January 2011, 07:13
  4. QListWidget doesn't show icons
    By franco.amato in forum Qt Programming
    Replies: 8
    Last Post: 16th March 2010, 14:15
  5. how to show richtext and icons in one widget in QT2
    By pencilren in forum Qt Programming
    Replies: 1
    Last Post: 16th May 2007, 10:30

Tags for this Thread

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
  •  
Qt is a trademark of The Qt Company.