title: Qt list of images
body: <p>I am looking for an efficient way to view a list of thumbnails of <em>jpeg</em>s in Qt 5.8 (possibly several thousands). </p>
  
  <p>My current approach is to use a <code>QListWidget</code> (see below, and <a href="https://stackoverflow.com/questions/14114737/which-qt-widget-to-use-for-implementing-image-thumbnail-browser-displaying-tile">this question</a>). This turns out to be way too slow as it takes forever to assemble, even for a few images. </p>
  
  <p>I am looking:</p>
  
  <ol>
  <li>To understand why my current approach is so slow.</li>
  <li>For a more efficient approach, which still requires only little code by relying as much as possible on Qt's features.</li>
  </ol>
  
  <p><strong>Current approach:</strong></p>
  
  <pre><code>ui-&gt;listWidget-&gt;setViewMode  (QListWidget::IconMode);
  ui-&gt;listWidget-&gt;setIconSize  (QSize(200,200)       );
  ui-&gt;listWidget-&gt;setResizeMode(QListWidget::Adjust  );
  
  for ( auto &amp;i : files ) 
    ui-&gt;listWidget-&gt;addItem(new QListWidgetItem(QIcon(i),i));
  </code></pre>
  
  <p><em>(whereby <code>files</code> is of the <code>std::vector&lt;QString&gt;</code> type)</em></p>