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. Images are not loaded when application starts through .desktop file.

Images are not loaded when application starts through .desktop file.

Scheduled Pinned Locked Moved Solved Installation and Deployment
8 Posts 3 Posters 2.1k 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
    adutzu89
    wrote on last edited by
    #1

    I have tried it on multiple Linux distributions and here is how it goes.
    Case 1:
    I start from menu or .desktop file than all images are not loaded.
    Case 2:
    I run directly from binary, everything get's loaded correctly.

    Any ideeas why?
    Qt version: 5.9.2, Linux distributions tested on: Ubuntu 16.04.3, Linux Deepin, Ubuntu 17.10, KDE Neon.
    Arhitecture: 64 bit on all platforms.

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      What images are you talking about?

      A 1 Reply Last reply
      0
      • ? A Former User

        What images are you talking about?

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

        @Wieland said in Images are not loaded when application starts through .desktop file.:

        What images are you talking about?

        PNG format images loaded through Image QML type inside the application.

        Here is the entry of the desktop file:

        [Desktop Entry]
        Type=Application
        Terminal=false
        Categories=Utility;
        Exec=/home/adi/Programe/Cumulus/Cumulus
        Name=Cumulus
        Icon=/home/adi/Programe/Cumulus/icons/hicolor/512x512/cumulus.png
        
        JonBJ 1 Reply Last reply
        0
        • ? Offline
          ? Offline
          A Former User
          wrote on last edited by
          #4

          Maybe you forgot to deploy the images? Or are they compiled into a Qt resource file? Did you check at run-time if the images' filepaths are valid?

          A 1 Reply Last reply
          1
          • A adutzu89

            @Wieland said in Images are not loaded when application starts through .desktop file.:

            What images are you talking about?

            PNG format images loaded through Image QML type inside the application.

            Here is the entry of the desktop file:

            [Desktop Entry]
            Type=Application
            Terminal=false
            Categories=Utility;
            Exec=/home/adi/Programe/Cumulus/Cumulus
            Name=Cumulus
            Icon=/home/adi/Programe/Cumulus/icons/hicolor/512x512/cumulus.png
            
            JonBJ Offline
            JonBJ Offline
            JonB
            wrote on last edited by JonB
            #5

            @adutzu89
            Are the image files specified by absolute path or relative path? Does the "run directly from binary" (presumably from shell terminal) still work if you first do a cd /tmp?

            A 2 Replies Last reply
            0
            • ? A Former User

              Maybe you forgot to deploy the images? Or are they compiled into a Qt resource file? Did you check at run-time if the images' filepaths are valid?

              A Offline
              A Offline
              adutzu89
              wrote on last edited by
              #6

              @Wieland said in Images are not loaded when application starts through .desktop file.:

              Maybe you forgot to deploy the images? Or are they compiled into a Qt resource file? Did you check at run-time if the images' filepaths are valid?

              The images are deployed and are not in Qt resource, like I mentioned before: If I run the binary directly(a.k.a. double-click / click+enter) or by command line, than the images are loaded.
              They are not loaded when the application start through .desktop file.

              1 Reply Last reply
              0
              • JonBJ JonB

                @adutzu89
                Are the image files specified by absolute path or relative path? Does the "run directly from binary" (presumably from shell terminal) still work if you first do a cd /tmp?

                A Offline
                A Offline
                adutzu89
                wrote on last edited by
                #7

                @JNBarchan

                Are the image files specified by absolute path or relative path?

                It is relative:

                QString prefix = "file:icons/hicolor/512x512/";
                

                I will try tommorrow and let you know if this is the cause(which at first glance seems most likely).

                1 Reply Last reply
                0
                • JonBJ JonB

                  @adutzu89
                  Are the image files specified by absolute path or relative path? Does the "run directly from binary" (presumably from shell terminal) still work if you first do a cd /tmp?

                  A Offline
                  A Offline
                  adutzu89
                  wrote on last edited by
                  #8

                  @JNBarchan

                  Setting absolute path worked, thank you for your help.

                  1 Reply Last reply
                  0

                  • Login

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