Qt Forum

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

    Update: Forum Guidelines & Code of Conduct

    Application icon for linux

    General and Desktop
    2
    2
    9271
    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.
    • P
      piciji last edited by

      Using setWindowIcon works for windows and mac, but not for linux. In ubuntu I only get a question mark icon in the left panel. I am using Ubuntu 12.04. I think Unity is the default gui. I have seen other executables which generate a nice icon in the left panel but have default icon in file explorer.

      application
      setWindowIcon (all os ? )

      pro file:
      rc file (win)
      icns (mac)
      in linux it's not that easy (the icon, displayed in file explorer is not part of the executable ?)

      1 Reply Last reply Reply Quote 0
      • C
        ChrisW67 last edited by

        I think it is adequately covered in the documentation under "Setting the Application Icon":http://qt-project.org/doc/qt-4.8/appicon.html and referenced "standards." The only part lacking is suggested location for the desktop files:

        • Per-user location for the desktop file is typically ".local/share/applications"
        • System wide "/usr/share/applications/".

        Your assessment is correct. The desktop icon on Linux is not part of the executable. It isn't for OS X either, it's just that the mechanism is standard so installing the separate file into the application bundle is easily automated. On Linux your installer (or application on first start) needs to take care of this based on the environment presented to it.

        On all platforms the desktop icon has no direct relationship to the application window icon. QApplication::setWindowIcon() works on all three desktop platforms.

        1 Reply Last reply Reply Quote 0
        • First post
          Last post