Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Icon in Qt

    General and Desktop
    2
    4
    2214
    Loading More Posts
    • 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
      basil_fawlty last edited by

      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 Reply Quote 0
      • G
        goetz last edited by

        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 Reply Quote 0
        • B
          basil_fawlty last edited by

          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 Reply Quote 0
          • G
            goetz last edited by

            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 Reply Quote 0
            • First post
              Last post