Results 1 to 2 of 2

Thread: .exe icon and mainwindow icon

  1. #1
    Join Date
    Jul 2008
    Location
    Munich
    Posts
    73
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default .exe icon and mainwindow icon

    I want to know whether it is possible to use two different icons for the .exe file and the program window icon.
    I currently have the icon in .rc file:


    Qt Code:
    1. IDI_ICON1 ICON "art_ir16x16.ico"
    To copy to clipboard, switch view to plain text mode 


    Then it works fine, the .exe file use this icon. But for beautifying reason, I want to show another icon in window corner.
    I used code in mainwindow:
    Qt Code:
    1. setWindowIcon(QIcon("icon_new.png"));
    To copy to clipboard, switch view to plain text mode 

    But I have the plugin structure, all the plugin modules can only have information about application icon with code "QApplication::windowIcon()". Instead of set each module for the same icon_new.png repeatly, what could I do to make it easier?

    Maybe anything to do in .rc file, e.g. "IDI_MAINFRAME "?

    Anyone can help? Thanks in advance.

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: .exe icon and mainwindow icon

    In your main() procedure, try calling QApplication::setWindowIcon() with your pixmap. If all the plugins call QApplication::windowIcon(), then they should retrieve the one you set at startup.

Similar Threads

  1. How to add icon?
    By soneday in forum Qt for Embedded and Mobile
    Replies: 2
    Last Post: 22nd December 2010, 20:13
  2. Replies: 0
    Last Post: 17th March 2010, 13:25
  3. Replies: 2
    Last Post: 12th October 2008, 14:42
  4. Couple of questions: main window icon + toolbar icon
    By bpackard in forum Qt Programming
    Replies: 0
    Last Post: 20th March 2008, 19:03
  5. Replies: 1
    Last Post: 17th January 2008, 10:17

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.