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?
QtWS25 Last Chance

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 last edited by
    #2

    Hiii
    How to add Qt application icon in ubuntu?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on 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 last edited by
        #4

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

        JonBJ 1 Reply Last reply
        0
        • V vaibs

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

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on 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 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

            JonBJ 1 Reply Last reply
            0
            • V vaibs

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

              JonBJ Offline
              JonBJ Offline
              JonB
              wrote on 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 last edited by
                #8

                @JonB Solved it.
                Thank you ..

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on 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 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 last edited by
                      #11

                      QMainWindow::setWindowIcon("name _of_png_file");

                      1 Reply Last reply
                      1

                      • Login

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