PDA

View Full Version : Slow loading images



abbapatris
18th February 2008, 18:10
I am trying to display icons for 25 buttons. I set the icon I want for each button using the UI editor and change the size to be (20,20). However when I try to load it takes it as many as 10 seconds to load. Is there anyway to speed this up, I am working on time critical software and need it to be as fast as possible.

Thanks

jacek
18th February 2008, 21:38
How big those images are?

abbapatris
19th February 2008, 21:45
If you are asking about the memory size they are no larger then 6kb...except for one that is 13kb. They are all PNG files and I resize them all down to 20x20. The original size was 100x100.

jacek
19th February 2008, 22:52
What layout do you use?

You can try to resize those images, so that Qt doesn't have to do this every time. You can also compile those images into your executable as resources.

abbapatris
21st February 2008, 11:46
they are part my my QRC file...is there something I should do other then that to compile them in?

bunjee
21st February 2008, 14:25
Seems quite slow, I'm doing the same with 100 pixmap and I don't get such slowdowns.

Can we see some code?

jacek
21st February 2008, 19:21
they are part my my QRC file...is there something I should do other then that to compile them in?
No, the problem most likely has something to do with the layouts.

abbapatris
21st February 2008, 19:25
I can't show you the code I am using. What I do doesn't allow it. The layout though is 2 labels set with a horizontal layout. One of the labels is set to the pixmap. There are about 20 of these and they are put together with a vertical layout.

Is that what you mean when you asked for the layout?

jacek
21st February 2008, 19:31
Is that what you mean when you asked for the layout?
Yes. Can you prepare a small compilable example that reproduces the problem?

abbapatris
22nd February 2008, 15:09
I will see what I can do, I wont be able to submit it until Monday. I will have to right a new program cause what I am working on isn't open to the public

abbapatris
5th March 2008, 15:52
Sorry I haven't responded...I have been pulled onto another project for the time being and they put this on the back burner.