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.
this
->setIconSize
(QSize(64*64);
for(int cnt=0; cnt<dirList.count();cnt++)
{
tempDirName= dirList.at(cnt);
// This image scaling takes long time 4 to 5 seconds on desktop & > 12 Sec on my ARM board
image = image.scaled(64,64,Qt::IgnoreAspectRation);
listItemRef->setIcon(imageIcon);
}
QListWidgetItem *listItemRef;
QPixmap pixmap;
QIcon icon;
QString tempDirName;
QDir dir("/home/nirav");
QStringList dirList = dir.entryList();
this->setIconSize(QSize(64*64);
for(int cnt=0; cnt<dirList.count();cnt++)
{
tempDirName= dirList.at(cnt);
listWidgetItem.append(new QListWidgetItem(this));
QImage image(temDirName);
QIcon imageIcon;
// This image scaling takes long time 4 to 5 seconds on desktop & > 12 Sec on my ARM board
image = image.scaled(64,64,Qt::IgnoreAspectRation);
imageIcon.addPixmap(QPixmap::fromImage(image),QIcon::Normal,QIcon::On);
listItemRef->setIcon(imageIcon);
}
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.
Bookmarks