Results 1 to 5 of 5

Thread: compile icon into application

  1. #1
    Join Date
    Apr 2009
    Posts
    6
    Thanks
    2

    Question compile icon into application

    Hi,
    is it possible to compile an icon directly into my application?
    I've build a button an set a QIcon:
    Qt Code:
    1. QPushButton button1 = new PushButton("button with icon", this);
    2. button1->setIcon(QIcon("path/to/icon");
    To copy to clipboard, switch view to plain text mode 
    But then the icon has to be in the directory of my application.
    Background is the licence of the icon-set. It is not allowed to distribute the icons, but to compile it into the application.

    I hope you can help me.
    Thanks in advance.
    Greetz,

    Jones

  2. #2
    Join Date
    Jan 2006
    Location
    travelling
    Posts
    1,116
    Thanks
    8
    Thanked 127 Times in 121 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: compile icon into application

    Would you be looking for the Resource System by any chance?

    It puzzled me to see how complicated it could be to reach this page, even knowing it existed so, for once, the blame is on the docs.
    Current Qt projects : QCodeEdit, RotiDeCode

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

    BlackFoXX (1st May 2009)

  4. #3
    Join Date
    Apr 2009
    Posts
    6
    Thanks
    2

    Default Re: compile icon into application

    Wow. Thanks for the fast answer.
    Looks good. It should help.
    Since i'm compiling my application with scons I hope it provides a tool for that.

  5. #4
    Join Date
    Jan 2006
    Location
    travelling
    Posts
    1,116
    Thanks
    8
    Thanked 127 Times in 121 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: compile icon into application

    Quote Originally Posted by BlackFoXX View Post
    Since i'm compiling my application with scons I hope it provides a tool for that.
    If scons supports Qt well enough to handle moc it should offer an easy way to manage qrc files. If it does not you can still generate the .cpp files by hand using rcc and add them to your project.
    Current Qt projects : QCodeEdit, RotiDeCode

  6. #5
    Join Date
    Apr 2009
    Posts
    6
    Thanks
    2

    Thumbs up Re: compile icon into application

    It works without any problems.
    Problem solved! Thread closed!

Similar Threads

  1. setting main application icon on windows
    By JeanC in forum Qt Programming
    Replies: 7
    Last Post: 12th June 2017, 05:35
  2. Compile Application in XCode for Release. How?
    By Alex Snet in forum Installation and Deployment
    Replies: 7
    Last Post: 3rd February 2009, 09:16
  3. Problem with application version and icon
    By cutie.monkey in forum Qt Programming
    Replies: 3
    Last Post: 18th December 2008, 01:22
  4. qtgui4.dll error in visual c++ 2005
    By Comptrol in forum Installation and Deployment
    Replies: 33
    Last Post: 19th June 2008, 07:18
  5. Mac application and the Dock Icon
    By sekelsenmat in forum Qt Programming
    Replies: 3
    Last Post: 26th September 2007, 10:23

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.