Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Icon in Qt
Forum Updated to NodeBB v4.3 + New Features

Icon in Qt

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 2.5k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    basil_fawlty
    wrote on last edited by
    #1

    As described "here":http://developer.qt.nokia.com/doc/qt-4.8/appicon.html it is easy to set an icon for mac.
    I have done as described:

    bq. If you are using qmake to generate your makefiles, you only need to add a single line to your .pro project file. For example, if the name of your icon file is myapp.icns, and your project file is myapp.pro, add this line to myapp.pro:
    ICON = myapp.icns

    And I also added this line

    QMAKE_INFO_PLIST = Info.plist

    My program compiles as usual but I cannot see an Icon. I would like to have it as an Dock-icon and as well as an icon before the file-name.

    What have I done wrong?

    1 Reply Last reply
    0
    • G Offline
      G Offline
      goetz
      wrote on last edited by
      #2

      So, you have the myapp.icns in your project?
      Does the contents of you individual Info.plist match the name of your icns file that is copied into the bundle later? Be aware that Info.plist refers to the filename in the bundle.

      http://www.catb.org/~esr/faqs/smart-questions.html

      1 Reply Last reply
      0
      • B Offline
        B Offline
        basil_fawlty
        wrote on last edited by
        #3

        Thank you for your answer. This plist-stuff is a bit confusing.
        According to the docu only this line:

        ICON= icon.icns

        would be enough. But it's not working. I have the plist line because I have seen it in an example.With it it compiles, but there is no icon to be seen.

        The icon is in project-folder. It has the name of my project.

        1 Reply Last reply
        0
        • G Offline
          G Offline
          goetz
          wrote on last edited by
          #4

          ICON= icon.icns just sets the icon that is shown in the Finder and in the Dock (if you don't set a different icon in the code). It must be in the special Mac icon format. You can create it with Icon Composer from other formats.

          For setting the application icon in window title bars etc, call setWindowIcon() in your code. That icon's format needs to be recognized by Qt, I usually use PNG here.

          The plist-line is not necessary to just set the icon, the two steps above are sufficient for that. Just make sure that your icns

          http://www.catb.org/~esr/faqs/smart-questions.html

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved