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. qt 4.8 application launcher icon - ubuntu 14.04
Forum Updated to NodeBB v4.3 + New Features

qt 4.8 application launcher icon - ubuntu 14.04

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 4 Posters 881 Views 2 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.
  • A Offline
    A Offline
    Anas_Deshmukh
    wrote on last edited by
    #1

    Hi all,

    i want to use application launcher icon in my desktop app.
    i do look over this Link but unable to tackle, i feel lost somewhere. kindly suggest me correct way to do it.

    i can share demo code if you guys want

    A 1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      @Anas_Deshmukh said in qt 4.8 application launcher icon - ubuntu 14.04:

      i feel lost somewhere

      You need to specify where you are lost, otherwise we can't help ;-)

      My recommendations:

      • take a look at linuxdeployqt https://github.com/probonopd/linuxdeployqt Not sure if it works with such ancient Qt version as 4.8
      • consider switching to newer Qt version
      • consider switching to newer OS

      (Z(:^

      1 Reply Last reply
      1
      • A Anas_Deshmukh

        Hi all,

        i want to use application launcher icon in my desktop app.
        i do look over this Link but unable to tackle, i feel lost somewhere. kindly suggest me correct way to do it.

        i can share demo code if you guys want

        A Offline
        A Offline
        ambershark
        wrote on last edited by ambershark
        #3

        @Anas_Deshmukh

        This is pretty easy, just create a .desktop file for your application and install it either system wide in /usr/share/applications or for the single user in ~/.local/share/applications.

        It should look something like this:

        [Desktop Entry]
        Name=Your Application Friendly Name
        GenericName=ShortAppName
        Type=Application
        Comment=My super cool app that does cool things
        Exec=/path/to/your/app
        Icon=/path/to/your/icon.png
        

        Then let's assume your app is called, someapp and your desktop file will be someapp.dekstop, you then just do sudo cp someapp.desktop /usr/share/applications to install it system wide (notice you need root permissions for this), or cp someapp.desktop ~/.local/share/applications/ for the local user, no root required.

        I usually mix this into my installer for my application. Usually in a bash script that looks something like (note this is just a portion of my install script, use as a reference only):

        if [ -e $ddfile ] && [ ! -n $OVERWRITE ]
        then
                echo "fail, $ddfile exists, not overwriting, use ./INSTALL --overwrite"
        else
                # make .desktop file
                echo "[Desktop Entry]" > $ddfile
                echo "Name=My App" >> $ddfile
                echo "GenericName=MyApp" >> $ddfile
                echo "Type=Application" >> $ddfile
                echo "Comment=Description of MyApp" >> $ddfile
                echo "Path=$installpath/myapp" >> $ddfile
                echo "Exec=$installpath/myapp/myapp" >> $ddfile
                echo "Icon=myapp" >> $ddfile
                echo "Terminal=false" >> $ddfile
                chmod 644 $ddfile
                echo "done"
        fi
        

        My Icon in this is set just to myapp, this is because myapp.png was installed in /usr/share/pixmaps so it doesn't need the full path. Likewise you can use ~/.local/share/pixmaps if installed user specific.

        Edit: just as a warning, some window managers don't pick up these changes immediately. So if that happens where it doesn't recognize your .desktop file in the launcher right away, then just restart your wm. Gnome and KDE tend to see it right away but I can't say that for the other wms.

        My L-GPL'd C++ Logger github.com/ambershark-mike/sharklog

        A 1 Reply Last reply
        4
        • A Offline
          A Offline
          Anas_Deshmukh
          wrote on last edited by
          #4

          @ambershark thank you for update, i will revert you soon. i am lil busy with other task as of now. will resume this thread again.

          1 Reply Last reply
          0
          • A ambershark

            @Anas_Deshmukh

            This is pretty easy, just create a .desktop file for your application and install it either system wide in /usr/share/applications or for the single user in ~/.local/share/applications.

            It should look something like this:

            [Desktop Entry]
            Name=Your Application Friendly Name
            GenericName=ShortAppName
            Type=Application
            Comment=My super cool app that does cool things
            Exec=/path/to/your/app
            Icon=/path/to/your/icon.png
            

            Then let's assume your app is called, someapp and your desktop file will be someapp.dekstop, you then just do sudo cp someapp.desktop /usr/share/applications to install it system wide (notice you need root permissions for this), or cp someapp.desktop ~/.local/share/applications/ for the local user, no root required.

            I usually mix this into my installer for my application. Usually in a bash script that looks something like (note this is just a portion of my install script, use as a reference only):

            if [ -e $ddfile ] && [ ! -n $OVERWRITE ]
            then
                    echo "fail, $ddfile exists, not overwriting, use ./INSTALL --overwrite"
            else
                    # make .desktop file
                    echo "[Desktop Entry]" > $ddfile
                    echo "Name=My App" >> $ddfile
                    echo "GenericName=MyApp" >> $ddfile
                    echo "Type=Application" >> $ddfile
                    echo "Comment=Description of MyApp" >> $ddfile
                    echo "Path=$installpath/myapp" >> $ddfile
                    echo "Exec=$installpath/myapp/myapp" >> $ddfile
                    echo "Icon=myapp" >> $ddfile
                    echo "Terminal=false" >> $ddfile
                    chmod 644 $ddfile
                    echo "done"
            fi
            

            My Icon in this is set just to myapp, this is because myapp.png was installed in /usr/share/pixmaps so it doesn't need the full path. Likewise you can use ~/.local/share/pixmaps if installed user specific.

            Edit: just as a warning, some window managers don't pick up these changes immediately. So if that happens where it doesn't recognize your .desktop file in the launcher right away, then just restart your wm. Gnome and KDE tend to see it right away but I can't say that for the other wms.

            A Offline
            A Offline
            Anas_Deshmukh
            wrote on last edited by
            #5

            @ambershark thank you for suggestion. It work smooth.

            aha_1980A 1 Reply Last reply
            2
            • A Anas_Deshmukh

              @ambershark thank you for suggestion. It work smooth.

              aha_1980A Offline
              aha_1980A Offline
              aha_1980
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Hi @Anas_Deshmukh,

              thanks for the feedback. Please mark this topic as SOLVED then.

              Qt has to stay free or it will die.

              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