Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. How to add Qt Application icon in ubuntu?

How to add Qt Application icon in ubuntu?

Scheduled Pinned Locked Moved Solved Installation and Deployment
hii how to addqt applicationicon in ubuntu
11 Posts 3 Posters 9.7k Views
  • 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.
  • V Offline
    V Offline
    vaibs
    wrote on 26 Apr 2019, 07:57 last edited by
    #1
    This post is deleted!
    1 Reply Last reply
    0
    • V Offline
      V Offline
      vaibs
      wrote on 26 Apr 2019, 08:00 last edited by
      #2

      Hiii
      How to add Qt application icon in ubuntu?

      1 Reply Last reply
      0
      • S Offline
        S Offline
        SGaist
        Lifetime Qt Champion
        wrote on 26 Apr 2019, 08:02 last edited by
        #3

        Hi,

        See the App Icon chapter in Qt's documentation.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        3
        • V Offline
          V Offline
          vaibs
          wrote on 26 Apr 2019, 10:29 last edited by
          #4

          I have read all documentation ..and try to implement that but not work..please help

          J 1 Reply Last reply 26 Apr 2019, 11:28
          0
          • V vaibs
            26 Apr 2019, 10:29

            I have read all documentation ..and try to implement that but not work..please help

            J Offline
            J Offline
            JonB
            wrote on 26 Apr 2019, 11:28 last edited by JonB
            #5

            @vaibs
            @SGaist has tried to help.

            You haven't explained what it is you want to do.

            If it's set the icon while an application is running, you can use QMainWindow::setWindowIcon().

            If it's set the icon for a desktop launcher, you'll have to create a .desktop file and put it on the right place. Mine happens to look like:

            [Desktop Entry]
            Version=1.0
            Type=Application
            Name=Jinn
            Icon=jinn.png
            Exec=python3 "Jinn/Code/home.py"
            Comment=Jinn Application
            Categories=Application
            Terminal=false
            

            Where that goes depends on desktop manger. Which you have not specified.

            I don't have time right now to type any more, see how you go.

            1 Reply Last reply
            3
            • V Offline
              V Offline
              vaibs
              wrote on 26 Apr 2019, 12:16 last edited by
              #6

              @JonB Thank you..
              I will try...
              I want set icon after run application in qt..But i want this work on ubuntu

              J 1 Reply Last reply 30 Apr 2019, 11:54
              0
              • V vaibs
                26 Apr 2019, 12:16

                @JonB Thank you..
                I will try...
                I want set icon after run application in qt..But i want this work on ubuntu

                J Offline
                J Offline
                JonB
                wrote on 30 Apr 2019, 11:54 last edited by
                #7

                @vaibs

                I want set icon after run application in qt

                Then if you're not trying to have the icon as a clickable link on your desktop, but simply to show up as the icon for the application once you run it, you won't need a .desktop file, you'll only need the QMainWindow::setWindowIcon().

                But i want this work on ubuntu

                That's why I gave you a working example on Ubuntu.

                1 Reply Last reply
                2
                • V Offline
                  V Offline
                  vaibs
                  wrote on 2 May 2019, 06:23 last edited by
                  #8

                  @JonB Solved it.
                  Thank you ..

                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on 2 May 2019, 06:49 last edited by
                    #9

                    Can you please share how you solved it ?

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    0
                    • V Offline
                      V Offline
                      vaibs
                      wrote on 4 May 2019, 06:49 last edited by
                      #10

                      @SGaist
                      Solved it by using QMainWindow::setWindowIcon() for setting icon .
                      Thank you...

                      1 Reply Last reply
                      0
                      • V Offline
                        V Offline
                        vaibs
                        wrote on 4 May 2019, 06:50 last edited by
                        #11

                        QMainWindow::setWindowIcon("name _of_png_file");

                        1 Reply Last reply
                        1

                        4/11

                        26 Apr 2019, 10:29

                        7 unread
                        • Login

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