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. [SOLVED] Icons are not visible when i run the application.
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] Icons are not visible when i run the application.

Scheduled Pinned Locked Moved General and Desktop
14 Posts 5 Posters 7.4k Views 1 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.
  • L Offline
    L Offline
    Leon
    wrote on 13 Jun 2013, 12:33 last edited by
    #1

    I have created the Qt resource file, and added some icons (jpg,png) to it and saved it
    In the designer, i have added a pushbutton, and changed it's icon to one from the resources files

    But when i run the application no icons appear...
    edit: Qt 5.02 on windows 8

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on 13 Jun 2013, 12:35 last edited by
      #2

      For jpg, you need the appropriate imageformat plugin to be present. Otherwise: check your paths. Are you sure that in your application the images come from the resources, and not from the file system?

      1 Reply Last reply
      0
      • L Offline
        L Offline
        Leon
        wrote on 13 Jun 2013, 12:41 last edited by
        #3

        [quote author="Andre" date="1371126946"]For jpg, you need the appropriate imageformat plugin to be present. Otherwise: check your paths. Are you sure that in your application the images come from the resources, and not from the file system?[/quote]

        i got the same problem on jpg and png.

        The pictures are located at
        Project folder/Pictures/Subfolder
        I have added a new resource file via right click on project->add new
        After that i created the pushbutton and changed the icon

        In other words i can see the icon when i am on the designer but when i execute it i don't

        1 Reply Last reply
        0
        • A Offline
          A Offline
          andre
          wrote on 13 Jun 2013, 12:47 last edited by
          #4

          What path are you using to load the icons?

          1 Reply Last reply
          0
          • L Offline
            L Offline
            Leon
            wrote on 13 Jun 2013, 13:00 last edited by
            #5

            [quote author="Andre" date="1371127662"]What path are you using to load the icons?[/quote]

            That's what i am trying to tell you this whole time :D
            I am using the designer to set the icons

            !http://i.imgur.com/nNmny23.png(1)!

            1 Reply Last reply
            0
            • F Offline
              F Offline
              francomartins
              wrote on 13 Jun 2013, 13:34 last edited by
              #6

              The solution is find and put the folder "imageformats" in the same folder of the app .

              or in the system32 folder, and add these lines in main.cpp.
              @

              ifdef Q_OS_WIN32

              QString env = getenv ("SYSTEMROOT");
              #endif

              ifdef Q_OS_WIN32

              QCoreApplication :: addLibraryPath (env + "\ system32");

              endif@

              1 Reply Last reply
              0
              • A Offline
                A Offline
                andre
                wrote on 13 Jun 2013, 13:37 last edited by
                #7

                That should not be needed for .png files. PNG support is build in, and does not rely on plugins.

                1 Reply Last reply
                0
                • L Offline
                  L Offline
                  Leon
                  wrote on 13 Jun 2013, 13:43 last edited by
                  #8

                  Must have something to do with Windows.
                  I am using icons this way 2 years on Qt for Ubuntu...

                  1 Reply Last reply
                  0
                  • M Offline
                    M Offline
                    musimbate
                    wrote on 14 Jun 2013, 06:32 last edited by
                    #9

                    Try cleaning the project and running qmake again.Had the same problem a few days ago and it seems that changes to the ressource files were being ignored.

                    Why join the navy if you can be a pirate?-Steve Jobs

                    1 Reply Last reply
                    0
                    • L Offline
                      L Offline
                      Leon
                      wrote on 14 Jun 2013, 12:42 last edited by
                      #10

                      [quote author="musimbate" date="1371191557"]Try cleaning the project and running qmake again.Had the same problem a few days ago and it seems that changes to the ressource files were being ignored.
                      [/quote]

                      Windows sucks balls!

                      Thank you it worked ;)

                      1 Reply Last reply
                      0
                      • A Offline
                        A Offline
                        andre
                        wrote on 14 Jun 2013, 12:54 last edited by
                        #11

                        In this case more likely it is qmake and the makefiles it generates that screw up...

                        1 Reply Last reply
                        0
                        • M Offline
                          M Offline
                          musimbate
                          wrote on 16 Jun 2013, 07:41 last edited by
                          #12

                          Glad it worked for you Leon.

                          Why join the navy if you can be a pirate?-Steve Jobs

                          1 Reply Last reply
                          0
                          • J Offline
                            J Offline
                            joshua-anderson
                            wrote on 18 Sept 2013, 00:36 last edited by
                            #13

                            Worked for me too. Has anyone filed a bug report yet?

                            1 Reply Last reply
                            0
                            • L Offline
                              L Offline
                              Leon
                              wrote on 18 Sept 2013, 10:49 last edited by
                              #14

                              [quote author="joshua-anderson" date="1379464605"]Worked for me too. Has anyone filed a bug report yet?[/quote]
                              there is no similar bug on qt bugreports

                              so here ya go!
                              https://bugreports.qt-project.org/browse/QTBUG-33541

                              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