Results 1 to 17 of 17

Thread: Icons are not visible when installing Qt application on end user machine ( Windows )

  1. #1
    Join Date
    Jul 2010
    Posts
    72
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4 Qt/Embedded Qt Jambi
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Icons are not visible when installing Qt application on end user machine ( Windows )

    Hello,
    I am junior software developer. I develop descktop applications using Qt application framework for 3 years. Currently I develop application that I putted(added) icons to it’s menues’ QActions, to buttons, to frames and windows, to textedit. I’ve created .qrc resource file and added icons from the resource file. I need to install the application on end user Windows XP(7) machine installing only .exe file and .dll libraries from the framework. When I install and launch the application on end user machine the icons are not visible, not loaded.The problem is that I have the icons visible only at the machine (OS) where I compiled and built the application and when putting the .exe file with needed .dlls(QtGui4.dll, QtCore4.dll,mingw10.dll,libgcc_s_dw2_1.dll) on the end user machine ( installation) the icons are not visible,not loaded.
    I have tried to use external binary resources ( I’ve compiled .qrc file with rcc and putted QResource::registerResource(…) ) and also I have tried compiled in resources and also tried to put icons from separate files. I made all the needed according to Qt Reference Documentation – the Qt Resource System. My icons are added to to .qrc resource file.
    But I see icons when I launch the application only at machine where I build the application and the icons are invisible when installing on end user machine. I build for Windows XP, 7. I also tried to install on end user machine the Qt SDK and copied my .exe file and .rcc file to directory ../Qt/2010.05/qt/bin, in such a case the icons are visible(loaded). But I don’t need the users(clients) installs something else and heavy besides my .exe file and .dlls of Qt you understand.
    Please help, advise what is the problem with icons ( resources ), when you will help me I’ll help you too from my experience with Qt.
    Pavel.

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,716
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Icons are not visible when installing Qt application on end user machine ( Window

    Make sure that you add the image qt codecs plugins that correspond to your icons (jpg svg etc) along with the other qt dlls.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    Feb 2011
    Location
    Italy
    Posts
    2
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Icons are not visible when installing Qt application on end user machine ( Window

    Also check that resources are compiled into exe

  4. #4
    Join Date
    Jul 2010
    Posts
    72
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4 Qt/Embedded Qt Jambi
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Icons are not visible when installing Qt application on end user machine ( Window

    Hi
    Thank you for your replies
    How can I check that resources were compiled to exe?
    If I see icons when I launch the application on the developer machine does not that say that resources were compiled?

    About plugin:
    What is a plugin? Where can I get it?
    No In Qt Reference documentation - Qt Resource system there is no word about need in any plugin
    Standart SDK is enought?


    Added after 12 minutes:


    So what does it mean?
    That I can't compile my application ones and install ( deploy ) on another machines with needed windows dlls with the icons seen?
    I begin to think the Qt developers make this so as not to make possible to redistribute made programs under GPL?
    Last edited by freely; 18th February 2011 at 11:14.

  5. #5
    Join Date
    Jul 2010
    Posts
    72
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4 Qt/Embedded Qt Jambi
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Icons are not visible when installing Qt application on end user machine ( Window

    So what does it mean?
    That I can't compile my application ones and install ( deploy ) on another machines with needed windows dlls with the icons seen?
    I begin to think the Qt developers make this so as not to make possible to redistribute made programs under GPL?

  6. #6
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,716
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Icons are not visible when installing Qt application on end user machine ( Window

    How can I check that resources were compiled to exe?
    A cpp file with the qrc file prefix should be compiled as part of the project.

    What is a plugin? Where can I get it?
    look under QTDIR\plugins\codecs
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  7. #7
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,716
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Icons are not visible when installing Qt application on end user machine ( Window

    Please don't multi post.
    Merging.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  8. #8
    Join Date
    Jul 2010
    Posts
    72
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4 Qt/Embedded Qt Jambi
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Lightbulb Re: Icons are not visible when installing Qt application on end user machine ( Window

    Hi
    The resources were compiled to exe sure there is coded images as hexadecimal numbers in .cpp file

    Regards codecs... perhaps it is the problem? I will check the plugins, but No - so Why when I deploy exe to ../Qt/2010.05/qt/bin the icons are visible?


    Added after 4 minutes:


    I have tried also to deploy with dlls from plugins/codecs , plugins/imageformats, plugins/iconengines but still I can't see icons
    I can see only when I install full Qt SDK and I deploy to qt/bin directory
    But we understand the end user should not install full Qt SDK so as to use application
    why such a problem?>
    Last edited by freely; 18th February 2011 at 11:41.

  9. #9
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,716
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Icons are not visible when installing Qt application on end user machine ( Window

    Are the Qt Dlls and your exe in the same folder?
    If not, you need to set the environment path as well.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  10. #10
    Join Date
    Jul 2010
    Posts
    72
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4 Qt/Embedded Qt Jambi
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Icons are not visible when installing Qt application on end user machine ( Window

    Sure My dll's and exe and all files are in one bundle(folder)

    sure dll's for the application, .exe, application service files installed in one folder to HDD to end user, the application is succeed to launch but icons not visible in places that I have included them

  11. #11
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,716
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Icons are not visible when installing Qt application on end user machine ( Window

    Do you have the following line in your pro file:
    RESOURCES = <you_resource_filename>.qrc

    Also, can you post one example line from your code, where you are accessing an image?
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  12. #12
    Join Date
    Jul 2010
    Posts
    72
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4 Qt/Embedded Qt Jambi
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Icons are not visible when installing Qt application on end user machine ( Window

    Hi
    Yes, sure
    the dlls, exe are in one folder, installed at end user machine to one folder
    I have added resources in .pro and also " registered " in main.cpp as it is explainded in Qt reference documentation

    Here is the example of image including from file generated by .uic after I've added icons in Qt Designer:


    Qt Code:
    1. QIcon icon1;
    2. icon1.addFile(QString::fromUtf8(":/Icons2/Tell a Friends.ico"), QSize(), QIcon::Normal, QIcon::Off);
    3. actionTell_a_friend->setIcon(icon1);
    4. actionContact_us = new QAction(MainWindow);
    5. actionContact_us->setObjectName(QString::fromUtf8("actionContact_us"));
    6. QIcon icon2;
    7. icon2.addFile(QString::fromUtf8(":/Icons2/Contact Us.ico"), QSize(), QIcon::Normal, QIcon::Off);
    8. actionContact_us->setIcon(icon2);
    9. actionQuit = new QAction(MainWindow);
    10. actionQuit->setObjectName(QString::fromUtf8("actionQuit"));
    11. ...
    To copy to clipboard, switch view to plain text mode 
    Last edited by high_flyer; 20th February 2011 at 11:47. Reason: code tags

  13. #13
    Join Date
    Oct 2009
    Posts
    364
    Thanks
    10
    Thanked 37 Times in 36 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Icons are not visible when installing Qt application on end user machine ( Window

    your app should be deployed like this:

    <app>.exe
    dlls that you listed before
    imageformats\qico4.dll

    hope this helps

  14. #14
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,716
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Icons are not visible when installing Qt application on end user machine ( Window

    Try renaming the icons to not include spaces.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  15. #15
    Join Date
    Jul 2010
    Posts
    72
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4 Qt/Embedded Qt Jambi
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Icons are not visible when installing Qt application on end user machine ( Window

    hey!
    Thank you very much
    Yea I try today to deploy with imageformats and iconengines dlls
    I fill it succeed!


    Thank you shnitzel
    you understand!

  16. #16
    Join Date
    Jul 2010
    Posts
    72
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4 Qt/Embedded Qt Jambi
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Icons are not visible when installing Qt application on end user machine ( Window

    Hello
    I deployed today with /plugins/imageformats folder
    It works only when I deploy may application exe, main Qt dlls and imageformats folder on windows
    How can I deploy on MacOS, Ubuntu, Symbian , Maemo?
    Thanks
    Pavel

  17. #17
    Join Date
    Jul 2010
    Posts
    72
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4 Qt/Embedded Qt Jambi
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Icons are not visible when installing Qt application on end user machine ( Window

    Thank you all
    I succeed to intstal the application with icons

    http://www.realvirtualdevelopment.co.nr

    Pavel

Similar Threads

  1. Replies: 16
    Last Post: 21st January 2011, 09:15
  2. Replies: 3
    Last Post: 12th July 2010, 06:25
  3. Replies: 7
    Last Post: 29th January 2009, 19:47
  4. no icons on the another machine (after installation)
    By roxton in forum Installation and Deployment
    Replies: 2
    Last Post: 4th July 2008, 17:24
  5. installing and Qt3 and Qt4 in a single machine
    By joseph in forum Installation and Deployment
    Replies: 1
    Last Post: 20th June 2007, 13:58

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.