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. Cannot seem to load any images/bitmaps from QT Creators resource system
Forum Updated to NodeBB v4.3 + New Features

Cannot seem to load any images/bitmaps from QT Creators resource system

Scheduled Pinned Locked Moved General and Desktop
29 Posts 3 Posters 5.9k 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.
  • M Offline
    M Offline
    mrjj
    Lifetime Qt Champion
    wrote on 15 Apr 2018, 10:50 last edited by mrjj
    #11

    Just to be clear.
    It shows the icons when you browse them but when you run INSIDE creator its
    not showing the images that should be compiled into the exe?

    Or is it only if you go double click the exe in the build folder?

    There is nothing you can de-select during install that disables ressources.
    Its a core feature.

    Could you try this test project ?
    https://www.dropbox.com/s/dfrdoju7fhr9tan/untitled56.zip?dl=0

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mnob
      wrote on 15 Apr 2018, 10:57 last edited by mnob
      #12

      " It shows the icons when you browse them but when you run INSIDE creator its
      not showing the images that should be compiled into the exe?"

      Exactly;-)

      M 1 Reply Last reply 15 Apr 2018, 11:02
      0
      • M mnob
        15 Apr 2018, 10:57

        " It shows the icons when you browse them but when you run INSIDE creator its
        not showing the images that should be compiled into the exe?"

        Exactly;-)

        M Offline
        M Offline
        mrjj
        Lifetime Qt Champion
        wrote on 15 Apr 2018, 11:02 last edited by mrjj
        #13

        @mnob
        Ok, and test project also does this ?
        Check if "Compiler output" contains
        C:\Qt\5.10.0\msvc2015_64\bin\rcc.exe -name icons ..\untitled56\icons.qrc -o debug\qrc_icons.cpp
        ( or similar if using mingw. path will be different to rcc.exe)
        Sounds like they are not compiled in for some reason.

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mnob
          wrote on 15 Apr 2018, 11:09 last edited by mnob
          #14

          The "Burning Sun's Avatar" thing is showing when running the application after
          setting the project up with the msvc kit option.

          'D:\QT_2nd\5.10.1\msvc2017_64\bin\rcc.exe -name icons ..\untitled56\icons.qrc -o debug\qrc_icons.cpp' <-- This does indeed show up in compiler output so the test project seems to work just fine.

          1 Reply Last reply
          0
          • M Offline
            M Offline
            mrjj
            Lifetime Qt Champion
            wrote on 15 Apr 2018, 11:11 last edited by
            #15

            Ok so your kit seems valid and rcc is run.

            Try to delete complete build folder for your project and
            run rebuild all and check if your project calls rcc.exe

            1 Reply Last reply
            1
            • M Offline
              M Offline
              mnob
              wrote on 15 Apr 2018, 11:23 last edited by mnob
              #16

              rcc is called and the .png shows up :
              D:\QT_2nd\5.10.1\msvc2017_64\bin\rcc.exe -name resource ..\QComboBoxDemo\resource.qrc -o debug\qrc_resource.cpp

              but this is still the only synthax that works:

              ui->comboBox->addItem(QIcon(":/png/foo"),"Hanko");

              Also before reinstalling no synthax variant at all worked, that's for shure.
              But now image loading is feasable of course, so the problem is not that urgent anymore. Still it's strange why other synthax variants don't work as supposed, and why things only started to come together after reinstalling Qt+Qt Creator. Anyways...

              1 Reply Last reply
              0
              • M Offline
                M Offline
                mrjj
                Lifetime Qt Champion
                wrote on 15 Apr 2018, 11:30 last edited by
                #17

                Hi
                That is a bit odd. But I have only used ":/" with icons and
                "qrc:/" with QML so would not have noticed if was broken once.
                Regarding the reinstall- maybe scanner ate rcc.exe the first time or something else
                blocked from being installed. Hard to guess at. its normally always included.

                1 Reply Last reply
                1
                • M Offline
                  M Offline
                  mnob
                  wrote on 15 Apr 2018, 11:35 last edited by mnob
                  #18

                  You mean anti-malware scanner? Well that would have to be windows defender then, since I don't have anything else installed of that nature.
                  Is there maybe still a way to somehow exclude rcc from installation by making wrong selections in the dialogs during installation of Qt+Qt Creator? You said it's a core feature, but...

                  M 1 Reply Last reply 15 Apr 2018, 11:41
                  0
                  • M mnob
                    15 Apr 2018, 11:35

                    You mean anti-malware scanner? Well that would have to be windows defender then, since I don't have anything else installed of that nature.
                    Is there maybe still a way to somehow exclude rcc from installation by making wrong selections in the dialogs during installation of Qt+Qt Creator? You said it's a core feature, but...

                    M Offline
                    M Offline
                    mrjj
                    Lifetime Qt Champion
                    wrote on 15 Apr 2018, 11:41 last edited by
                    #19

                    @mnob
                    Yeah, but its rare i have seen Defender eat anything so most likely something else.
                    As far as I know, rcc i included in all precompiled and there is no option to not have it installed.

                    1 Reply Last reply
                    0
                    • M Offline
                      M Offline
                      mnob
                      wrote on 15 Apr 2018, 13:59 last edited by mnob
                      #20

                      Hm, removed the mingw53_32 folder from the installation because I thought that
                      maybe "QT Creator" itself somehow needed mingw53_32 to be present to function correctly, but nothing changed. The path to the alias still works correctly although
                      other synthaxes don't work, but that seems to be another issue so maybe my build directory just got corrupted somehow. Anyhow thanks for your help.

                      1 Reply Last reply
                      0
                      • M Offline
                        M Offline
                        mnob
                        wrote on 15 Apr 2018, 14:53 last edited by mnob
                        #21

                        The non-alias resource path works too now. Cool ;-)

                        1 Reply Last reply
                        0
                        • M Offline
                          M Offline
                          mnob
                          wrote on 15 Apr 2018, 15:50 last edited by mnob
                          #22

                          You can't seem to use a non-alias resource path once an alias has been assigned.

                          M 1 Reply Last reply 15 Apr 2018, 15:55
                          0
                          • M mnob
                            15 Apr 2018, 15:50

                            You can't seem to use a non-alias resource path once an alias has been assigned.

                            M Offline
                            M Offline
                            mrjj
                            Lifetime Qt Champion
                            wrote on 15 Apr 2018, 15:55 last edited by
                            #23

                            @mnob
                            Like
                            <file alias="cut-img.png">images/cut.png</file>
                            and then you cannot use ":/images/cut-img.png" anymore ?

                            1 Reply Last reply
                            0
                            • M Offline
                              M Offline
                              mnob
                              wrote on 15 Apr 2018, 16:37 last edited by mnob
                              #24

                              Exactly. Once an alias has been defined, I can access the resource by that alias exclusively.

                              M 1 Reply Last reply 15 Apr 2018, 16:43
                              0
                              • M mnob
                                15 Apr 2018, 16:37

                                Exactly. Once an alias has been defined, I can access the resource by that alias exclusively.

                                M Offline
                                M Offline
                                mrjj
                                Lifetime Qt Champion
                                wrote on 15 Apr 2018, 16:43 last edited by
                                #25

                                @mnob
                                Ok, not sure if by design or not working.

                                1 Reply Last reply
                                0
                                • M Offline
                                  M Offline
                                  mnob
                                  wrote on 15 Apr 2018, 16:47 last edited by mnob
                                  #26

                                  Seems to be the same for Desktop_Qt_5_10_1_MinGW_32bit-Debug.

                                  Before I was using Desktop_Qt_5_10_1_MSVC2017_64bit-Debug.

                                  M 1 Reply Last reply 15 Apr 2018, 16:57
                                  0
                                  • M mnob
                                    15 Apr 2018, 16:47

                                    Seems to be the same for Desktop_Qt_5_10_1_MinGW_32bit-Debug.

                                    Before I was using Desktop_Qt_5_10_1_MSVC2017_64bit-Debug.

                                    M Offline
                                    M Offline
                                    mrjj
                                    Lifetime Qt Champion
                                    wrote on 15 Apr 2018, 16:57 last edited by
                                    #27

                                    @mnob
                                    Hi
                                    I thinks by design. Its not ALSO listed under org name so
                                    only the alias name is available.

                                    1 Reply Last reply
                                    0
                                    • M Offline
                                      M Offline
                                      mnob
                                      wrote on 15 Apr 2018, 16:59 last edited by mnob
                                      #28

                                      O.K. I see.

                                      1 Reply Last reply
                                      0
                                      • M Offline
                                        M Offline
                                        mnob
                                        wrote on 19 Apr 2018, 21:17 last edited by mnob
                                        #29

                                        Seems like it helps to delete the build folder or clean project and run qmake+rebuild.

                                        1 Reply Last reply
                                        0

                                        20/29

                                        15 Apr 2018, 13:59

                                        • Login

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