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. svg no such file or directory

svg no such file or directory

Scheduled Pinned Locked Moved Solved General and Desktop
13 Posts 2 Posters 3.0k 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.
  • T Offline
    T Offline
    Tink
    wrote on 3 Jun 2022, 07:47 last edited by
    #1

    When trying to use a qt commonstyle svg file for a QIcon, or in a stylesheet i get this:
    qt.svg: Cannot open file ':/qt-project.org/styles/commonstyle/images/question.svg', because: No such file or directory

    But referencing a commonstyle png file works. And if i put the svg file in my own resource file it works as expected.
    Am i doing something wrong?

    1 Reply Last reply
    0
    • C Offline
      C Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on 3 Jun 2022, 08:06 last edited by
      #2

      And you're sure that the svg file exists in this resource? I would guess no.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      0
      • T Offline
        T Offline
        Tink
        wrote on 3 Jun 2022, 08:33 last edited by
        #3

        You are right. I checked with QDir entrylist and all it can find are the png files.
        Thing is, in the source files they are all together in that path.
        So where are they! :)

        C 1 Reply Last reply 3 Jun 2022, 08:46
        0
        • T Tink
          3 Jun 2022, 08:33

          You are right. I checked with QDir entrylist and all it can find are the png files.
          Thing is, in the source files they are all together in that path.
          So where are they! :)

          C Offline
          C Offline
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on 3 Jun 2022, 08:46 last edited by
          #4

          @Tink said in svg no such file or directory:

          So where are they! :)

          When you don't add them in your qrc file they won't be added.

          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
          Visit the Qt Academy at https://academy.qt.io/catalog

          1 Reply Last reply
          0
          • T Offline
            T Offline
            Tink
            wrote on 3 Jun 2022, 09:04 last edited by
            #5

            Well that is very strange since all the png files are added by default. No need to put them in my own resource file.
            But not the svg files... Those svg's are used however by standard widgets like QCombobox. So one would think that they can be referenced as well.

            C 1 Reply Last reply 3 Jun 2022, 09:07
            0
            • T Tink
              3 Jun 2022, 09:04

              Well that is very strange since all the png files are added by default. No need to put them in my own resource file.
              But not the svg files... Those svg's are used however by standard widgets like QCombobox. So one would think that they can be referenced as well.

              C Offline
              C Offline
              Christian Ehrlicher
              Lifetime Qt Champion
              wrote on 3 Jun 2022, 09:07 last edited by
              #6

              @Tink said in svg no such file or directory:

              No need to put them in my own resource file.

              You have to do it somewhere - nothing is added automatically. But since you're using ':/qt-project.org it's maybe a resource file inside the Qt libraries what you're using. And there only the png files were added to the qrc file: https://code.qt.io/cgit/qt/qtbase.git/tree/src/widgets/CMakeLists.txt#n71

              Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
              Visit the Qt Academy at https://academy.qt.io/catalog

              1 Reply Last reply
              1
              • T Offline
                T Offline
                Tink
                wrote on 3 Jun 2022, 09:19 last edited by
                #7

                Yeah that must be it.
                Have any idea if the svg's can also be utilized?

                C 1 Reply Last reply 3 Jun 2022, 09:21
                0
                • T Tink
                  3 Jun 2022, 09:19

                  Yeah that must be it.
                  Have any idea if the svg's can also be utilized?

                  C Offline
                  C Offline
                  Christian Ehrlicher
                  Lifetime Qt Champion
                  wrote on 3 Jun 2022, 09:21 last edited by
                  #8

                  @Tink said in svg no such file or directory:

                  Have any idea if the svg's can also be utilized?

                  add them by yourself in your qrc file.

                  Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                  Visit the Qt Academy at https://academy.qt.io/catalog

                  T 1 Reply Last reply 3 Jun 2022, 09:25
                  0
                  • C Christian Ehrlicher
                    3 Jun 2022, 09:21

                    @Tink said in svg no such file or directory:

                    Have any idea if the svg's can also be utilized?

                    add them by yourself in your qrc file.

                    T Offline
                    T Offline
                    Tink
                    wrote on 3 Jun 2022, 09:25 last edited by
                    #9

                    @Christian-Ehrlicher said in svg no such file or directory:

                    @Tink said in svg no such file or directory:

                    Have any idea if the svg's can also be utilized?

                    add them by yourself in your qrc file.

                    Yes but besides doing that.

                    C 1 Reply Last reply 3 Jun 2022, 09:27
                    0
                    • T Tink
                      3 Jun 2022, 09:25

                      @Christian-Ehrlicher said in svg no such file or directory:

                      @Tink said in svg no such file or directory:

                      Have any idea if the svg's can also be utilized?

                      add them by yourself in your qrc file.

                      Yes but besides doing that.

                      C Offline
                      C Offline
                      Christian Ehrlicher
                      Lifetime Qt Champion
                      wrote on 3 Jun 2022, 09:27 last edited by
                      #10

                      @Tink said in svg no such file or directory:

                      Yes but besides doing that.

                      ??

                      Wait until someone adds them in the Qt sources then wait until this Qt version is released and use this Qt version.

                      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                      Visit the Qt Academy at https://academy.qt.io/catalog

                      T 1 Reply Last reply 3 Jun 2022, 09:28
                      0
                      • C Christian Ehrlicher
                        3 Jun 2022, 09:27

                        @Tink said in svg no such file or directory:

                        Yes but besides doing that.

                        ??

                        Wait until someone adds them in the Qt sources then wait until this Qt version is released and use this Qt version.

                        T Offline
                        T Offline
                        Tink
                        wrote on 3 Jun 2022, 09:28 last edited by
                        #11

                        @Christian-Ehrlicher said in svg no such file or directory:

                        @Tink said in svg no such file or directory:

                        Yes but besides doing that.

                        ??

                        Wait until someone adds them in the Qt sources then wait until this Qt version is released and use this Qt version.

                        Euhm... they are in the Qt sources?
                        https://code.qt.io/cgit/qt/qtbase.git/tree/src/widgets/styles/images

                        C 1 Reply Last reply 3 Jun 2022, 09:37
                        0
                        • T Tink
                          3 Jun 2022, 09:28

                          @Christian-Ehrlicher said in svg no such file or directory:

                          @Tink said in svg no such file or directory:

                          Yes but besides doing that.

                          ??

                          Wait until someone adds them in the Qt sources then wait until this Qt version is released and use this Qt version.

                          Euhm... they are in the Qt sources?
                          https://code.qt.io/cgit/qt/qtbase.git/tree/src/widgets/styles/images

                          C Offline
                          C Offline
                          Christian Ehrlicher
                          Lifetime Qt Champion
                          wrote on 3 Jun 2022, 09:37 last edited by
                          #12

                          @Tink said in svg no such file or directory:

                          Euhm... they are in the Qt sources?

                          And? Noone added them to the CMakeLists.txt as I showed you above... so you have to wait until someone is doing this.

                          Don't know where this discussion should go to though...

                          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                          Visit the Qt Academy at https://academy.qt.io/catalog

                          1 Reply Last reply
                          0
                          • T Offline
                            T Offline
                            Tink
                            wrote on 3 Jun 2022, 09:40 last edited by Tink 6 Mar 2022, 09:40
                            #13

                            Ok well thanks for your help, i am just trying to get a better understanding. I mark this as solved. Thanks.

                            1 Reply Last reply
                            0

                            10/13

                            3 Jun 2022, 09:27

                            • Login

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