I am looking for an efficient way to view a list of thumbnails of jpegs in Qt 5.8 (possibly several thousands).
My current approach is to use a QListWidget
(see below, and this question). This turns out to be way too slow as it takes forever to assemble, even for a few images.
I am looking:
- To understand why my current approach is so slow.
- For a more efficient approach, which still requires only little code by relying as much as possible on Qt's features.
Current approach:
ui->listWidget->setViewMode (QListWidget::IconMode);
ui->listWidget->setIconSize (QSize(200,200) );
ui->listWidget->setResizeMode(QListWidget::Adjust );
for ( auto &i : files )
ui->listWidget->addItem(new QListWidgetItem(QIcon(i),i));
(whereby files
is of the std::vector<QString>
type)