Hi,

I am using List of QListWidgetItem inside QListWidget, and show the the image file in thumbnail view by scaling the image size to 64*64.

But this image scaling and showing Image as icon in 64*64 size takes long time.
Qt Code:
  1. QListWidgetItem *listItemRef;
  2. QPixmap pixmap;
  3. QIcon icon;
  4. QString tempDirName;
  5. QDir dir("/home/nirav");
  6.  
  7. QStringList dirList = dir.entryList();
  8.  
  9. this->setIconSize(QSize(64*64);
  10.  
  11. for(int cnt=0; cnt<dirList.count();cnt++)
  12. {
  13. tempDirName= dirList.at(cnt);
  14. listWidgetItem.append(new QListWidgetItem(this));
  15. QImage image(temDirName);
  16. QIcon imageIcon;
  17.  
  18. // This image scaling takes long time 4 to 5 seconds on desktop & > 12 Sec on my ARM board
  19. image = image.scaled(64,64,Qt::IgnoreAspectRation);
  20. imageIcon.addPixmap(QPixmap::fromImage(image),QIcon::Normal,QIcon::On);
  21. listItemRef->setIcon(imageIcon);
  22. }
To copy to clipboard, switch view to plain text mode 

Can anybody suggest me, right way to load image as icon in listwidget with minimum time duration.