Results 1 to 4 of 4

Thread: Icons from resource file not shown when linking to Qt statically

  1. #1
    Join Date
    May 2011
    Posts
    46
    Thanks
    5

    Default Icons from resource file not shown when linking to Qt statically

    I have a main window with a toolbar that has some tool buttons on it.
    The resource file has just 1 icon and is used as the main window's icon, and tool button's icon.
    The code looks like this
    Qt Code:
    1. setWindowIcon(QIcon(":/my/app.ico"));
    2. toolbar->addAction(QIcon(":/my/app.ico"),"About");
    To copy to clipboard, switch view to plain text mode 
    I also had called Q_INIT_RESOURCE in the main.
    Everything work fine when linking with Qt dynamically, however the icon won't display in both places when linking with Qt statically.
    Please let me know what did I do wrong

  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: Icons from resource file not shown when linking to Qt statically

    Have you got the ICO image format plugin built in?

  3. #3
    Join Date
    May 2011
    Posts
    46
    Thanks
    5

    Default Re: Icons from resource file not shown when linking to Qt statically

    I am not sure what you are talking about, I can found "qico.lib" under qt_root\plugins\imageformats\, you mean I should link to this lib as well?
    Or you mean I have to explicitly specify this lib when building qt statically?

  4. #4
    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 from resource file not shown when linking to Qt statically

    try reading the section on 'static plug-ins':
    http://developer.qt.nokia.com/doc/qt...ins-howto.html

  5. The following user says thank you to schnitzel for this useful post:

    grayfox (29th June 2011)

Similar Threads

  1. How to load icons from resource file
    By joseph in forum Qt Programming
    Replies: 7
    Last Post: 25th June 2012, 07:00
  2. Best practice naming convention for icons sets in resource file
    By stefanadelbert in forum Qt Programming
    Replies: 7
    Last Post: 27th May 2011, 02:54
  3. Replies: 2
    Last Post: 5th March 2010, 09:26
  4. Statically Linking... everything
    By bpetty in forum Newbie
    Replies: 5
    Last Post: 26th October 2006, 17:43
  5. Replies: 3
    Last Post: 26th July 2006, 13:23

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.