Results 1 to 11 of 11

Thread: Slow loading images

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2007
    Posts
    52
    Thanks
    6

    Default Slow loading images

    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

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Slow loading images

    How big those images are?
    Last edited by jacek; 19th February 2008 at 23:47. Reason: typo

  3. #3
    Join Date
    Jun 2007
    Posts
    52
    Thanks
    6

    Default Re: Slow loading images

    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.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Slow loading images

    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.

  5. #5
    Join Date
    Jun 2007
    Posts
    52
    Thanks
    6

    Default Re: Slow loading images

    they are part my my QRC file...is there something I should do other then that to compile them in?

  6. #6
    Join Date
    Jan 2007
    Location
    Paris
    Posts
    459
    Thanks
    98
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4 Qt5

    Default Re: Slow loading images

    Seems quite slow, I'm doing the same with 100 pixmap and I don't get such slowdowns.

    Can we see some code?

  7. #7
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Slow loading images

    Quote Originally Posted by abbapatris View Post
    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.

  8. #8
    Join Date
    Jun 2007
    Posts
    52
    Thanks
    6

    Default Re: Slow loading images

    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?

  9. #9
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Slow loading images

    Quote Originally Posted by abbapatris View Post
    Is that what you mean when you asked for the layout?
    Yes. Can you prepare a small compilable example that reproduces the problem?

  10. #10
    Join Date
    Jun 2007
    Posts
    52
    Thanks
    6

    Default Re: Slow loading images

    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

  11. #11
    Join Date
    Jun 2007
    Posts
    52
    Thanks
    6

    Default Re: Slow loading images

    Sorry I haven't responded...I have been pulled onto another project for the time being and they put this on the back burner.

Similar Threads

  1. Loading images in html in a QTextBrowser
    By BasicPoke in forum Newbie
    Replies: 1
    Last Post: 6th June 2007, 22:51
  2. Loading images in QTextBrowser
    By nisha0609 in forum Qt Programming
    Replies: 1
    Last Post: 3rd January 2007, 10:44

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.