Results 1 to 13 of 13

Thread: how to browse images in thumbnail view?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2008
    Posts
    23
    Thanks
    1
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Question how to browse images in thumbnail view?

    hi, there
    My application needs to browse thousands of images in thumbnail view. I tried QListWidget with icon mode but found it's extremely slow and memory consuming. Many image browser software like GWinView, which is using qt3, handles the problem nicely. How can I do this in qt4? The images are jpg or png format (I won't try other format at this time.) Here is the piece of code:

    Qt Code:
    1. while (myIterator.hasNext())
    2. {
    3. QString myFileName = myIterator.next();
    4. QFileInfo myFileInfo(myFileName);
    5. if (!myFileInfo.isFile()) continue;
    6. QPixmap myPixmap(myFileName);
    7. QListWidgetItem * mypItem = new QListWidgetItem(myFileInfo.baseName());
    8. mypItem->setIcon(myPixmap);
    9. mypItem->setData(Qt::UserRole,myFileName);
    10. listWgt1->addItem(mypItem);
    11. }
    12. listWgt1->sortItems(Qt::AscendingOrder);
    To copy to clipboard, switch view to plain text mode 

    The listWgt1 is a QListWidget set to icon mode. Comparing to Gwenview, the loading time is about twice longer and the scrolling is noticeably delayed (but tolerable). The scaling of thumbnails are fast. The memory consuming is much much larger than Gwenview.

    Is there any other approach that I can do the thumbview in qt4 fast and memory efficient? (for several thousands of images). Thanks for help.

    zl2k
    Last edited by jpn; 13th September 2008 at 18:52. Reason: changed [quote] to [code] tags

Similar Threads

  1. How to view images using QT
    By Pitso in forum Newbie
    Replies: 1
    Last Post: 16th April 2007, 14:00

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
  •  
Qt is a trademark of The Qt Company.