QLabel with the QPixmap blues
-
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...
Then there's this...
So at run time I get this...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.
-
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.
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.
-
Hi
I cant guess what goes wrong. all seems fine. :)Sample here.
https://www.dropbox.com/s/q41hgzc36xqx482/mycons.zip?dl=0expected result.
-
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. -
@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 ? -
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. -
@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 ;) -
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!
-
@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) -
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.