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. QLabel with the QPixmap blues
Forum Updated to NodeBB v4.3 + New Features

QLabel with the QPixmap blues

Scheduled Pinned Locked Moved Solved General and Desktop
20 Posts 3 Posters 3.3k 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.
  • WillyBoy 0W Offline
    WillyBoy 0W Offline
    WillyBoy 0
    wrote on last edited by
    #10

    Thanks for the responses. First, I did a Clean-All and the qmake, no difference. mranger90, I am developing and trageting Linux Ubuntu so window quarks, not really a problem. Also I use .png as my goto default format for images. Someone asked about the QPixmap being hidden so I change cpp to this...
    0_1524838427450_XX_cpp.png
    Then there's this...
    0_1524838489614_XX_Design.png
    So at run time I get this...0_1524838562776_XX_Run.png

    I would think of a corrupted .qrc file but it compiles with no errors. I'm thinking that there must be something with the way I'm calling for the Pixmap change that is at fault but everywhere I look they reference this method. Can anyone offer a different way? This project is in limbo until I find a way to get this to work. My original app. had numerous events where ToolBar Button icons would change to indicate the state of the classes they controlled. This just seemed to be an easier way.

    If I have seen further than others... It is because I have stood on the shoulders of giants!

    1 Reply Last reply
    0
    • mranger90M Offline
      mranger90M Offline
      mranger90
      wrote on last edited by
      #11

      At this point, all I can suggest is that you simplify.
      Write a really small app, say a dialog with just a QLabel,
      and and try to load your image into the QPixmap both as from an external file,
      and from the resource tree.

      1 Reply Last reply
      1
      • WillyBoy 0W Offline
        WillyBoy 0W Offline
        WillyBoy 0
        wrote on last edited by
        #12

        OK I did as you (and I) wanted and that was do a simple dialog and see what happens. So I built a simple Dialog project ON A DIFFERENT COMPUTER with different resources in the .qrc file and the results were exactly the same.

        0_1524963121314_BuildProb_001.png

        So I can only suspect that my method is in error. Can someone lend who or how I can resolve. Can someone do the same with a quick project and either confirm my results or, and I hope, show me my error(s). Thanks for all the support.

        If I have seen further than others... It is because I have stood on the shoulders of giants!

        1 Reply Last reply
        0
        • mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #13

          Hi
          I cant guess what goes wrong. all seems fine. :)

          Sample here.
          https://www.dropbox.com/s/q41hgzc36xqx482/mycons.zip?dl=0

          expected result.
          alt text

          1 Reply Last reply
          1
          • WillyBoy 0W Offline
            WillyBoy 0W Offline
            WillyBoy 0
            wrote on last edited by
            #14

            PROBLEM SOLVED
            I want to thank mrjj for making a simple project "mycons". It was when I looked at his files and made a quick comparison that the solution jumped out at me. When he made his .qrc file he added icons that were in the root folder. I was porting over a Borland project and just used the same folders for graphics I used back then. They were in sub folders according to pixel size, '16' '24' and '32'. I just batched renamed the 32_XXX with size first then _sequential numbers. When I wanted to get the name I just looked in the .qrc and saw <file>32/32_072.png</file> so that is what I used. BUT the <file> line was wrapped in <qresource prefix = "/32"> </qresource>. So when I used :32/32_072.png as the QPixmap file, I should have been using :/32/32/32_072.png. At that time I became blind to the oversight and just went, off the deep end. This is why it is so hard to be a lone programmer, lesson learned. Thanks again mrjj its always the minutia that brings us to our knees. Thanks again to all that responded.

            If I have seen further than others... It is because I have stood on the shoulders of giants!

            mrjjM 1 Reply Last reply
            1
            • WillyBoy 0W WillyBoy 0

              PROBLEM SOLVED
              I want to thank mrjj for making a simple project "mycons". It was when I looked at his files and made a quick comparison that the solution jumped out at me. When he made his .qrc file he added icons that were in the root folder. I was porting over a Borland project and just used the same folders for graphics I used back then. They were in sub folders according to pixel size, '16' '24' and '32'. I just batched renamed the 32_XXX with size first then _sequential numbers. When I wanted to get the name I just looked in the .qrc and saw <file>32/32_072.png</file> so that is what I used. BUT the <file> line was wrapped in <qresource prefix = "/32"> </qresource>. So when I used :32/32_072.png as the QPixmap file, I should have been using :/32/32/32_072.png. At that time I became blind to the oversight and just went, off the deep end. This is why it is so hard to be a lone programmer, lesson learned. Thanks again mrjj its always the minutia that brings us to our knees. Thanks again to all that responded.

              mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on last edited by
              #15

              @WillyBoy-0
              Hi, no troubles.
              Ah, that was somewhat sneaky.
              For the record, right clicking the image in project tree, shows the correct path or
              did it miss the extra 32 path part ?

              1 Reply Last reply
              0
              • WillyBoy 0W Offline
                WillyBoy 0W Offline
                WillyBoy 0
                wrote on last edited by
                #16

                Hi mrjj, hovering over an item in the .qrc file displays the raw computer location (again a mislead for me) but right click options are Creator's path (:/32/32/32_073.png) or the url (qrc:/32/32/32_073.png) just remove the qrc bit and that's what is needed.
                Very cool. One more sidebar, how do I mark this thread SOLVED? Again thanks, btw I'm moving to Florida in the coming weeks so I will have to suspend my project for awhile. But I plan to give renewed life to all 11 of my old Borland projects but most of them need some upgrades to compete today.

                If I have seen further than others... It is because I have stood on the shoulders of giants!

                mrjjM 1 Reply Last reply
                0
                • WillyBoy 0W WillyBoy 0

                  Hi mrjj, hovering over an item in the .qrc file displays the raw computer location (again a mislead for me) but right click options are Creator's path (:/32/32/32_073.png) or the url (qrc:/32/32/32_073.png) just remove the qrc bit and that's what is needed.
                  Very cool. One more sidebar, how do I mark this thread SOLVED? Again thanks, btw I'm moving to Florida in the coming weeks so I will have to suspend my project for awhile. But I plan to give renewed life to all 11 of my old Borland projects but most of them need some upgrades to compete today.

                  mrjjM Offline
                  mrjjM Offline
                  mrjj
                  Lifetime Qt Champion
                  wrote on last edited by mrjj
                  #17

                  @WillyBoy-0
                  Hi
                  On first post u made. In Topic tools. is way to say Solved.
                  Oh, happy moving then.
                  You will find that Qt does most of what VCL does/did.
                  I hope its that new and not the good old OWL ;)

                  1 Reply Last reply
                  0
                  • WillyBoy 0W Offline
                    WillyBoy 0W Offline
                    WillyBoy 0
                    wrote on last edited by
                    #18

                    Yup, VCL! Most for what I did was local db (back then, Paradox 7, with the BDE) with focus on the Automotive Repair industry. With an offshoot to Independent Day Care Software for small to medium in-home sites. A sysbar app GotMail? for email notification (2003), outdated now. But I have stuff to keep me busy for awhile. I won't miss Pennsylvania winters, that's for sure!

                    If I have seen further than others... It is because I have stood on the shoulders of giants!

                    mrjjM 1 Reply Last reply
                    0
                    • WillyBoy 0W WillyBoy 0

                      Yup, VCL! Most for what I did was local db (back then, Paradox 7, with the BDE) with focus on the Automotive Repair industry. With an offshoot to Independent Day Care Software for small to medium in-home sites. A sysbar app GotMail? for email notification (2003), outdated now. But I have stuff to keep me busy for awhile. I won't miss Pennsylvania winters, that's for sure!

                      mrjjM Offline
                      mrjjM Offline
                      mrjj
                      Lifetime Qt Champion
                      wrote on last edited by
                      #19

                      @WillyBoy-0
                      Hehe i guess nobody would miss Pennsylvania winters :)

                      To replace BDE, Sqlite might be handy. Qt has excellent support.
                      (if needs are only local db)

                      1 Reply Last reply
                      0
                      • WillyBoy 0W Offline
                        WillyBoy 0W Offline
                        WillyBoy 0
                        wrote on last edited by
                        #20

                        In an earlier post you can see I've already committed to SQLite,. It seamed to be a logical choice and mirrors Paradox pretty close, as far as function. I've done MySQL both local and remote before and it's pretty straight forward and easy to use but I see it as a Mustang when a Escort will do. And besides, copy and paste is a DB backup dream.

                        If I have seen further than others... It is because I have stood on the shoulders of giants!

                        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