{
if (item != NULL) {
item
->setData
(QImage(item
->data
(MainWindow
::ImagePathRole).
toString()).
scaled(64,
64), Qt
::DecorationRole);
}
}
void MainWindow
::onDirViewActivated(QModelIndex index
) // if this is called again before the thumbnail functions end, it will segfault. {
qDebug() << dirTreeModel->data(index).toString();
QDirIterator i
("/home/michael/Pictures",
QDir::Files);
// fix this to use the selected dir imageListModel->clear();
while (i.hasNext()) {
i.next();
item->setData(i.filePath(), ImagePathRole);
QtConcurrent::run(getThumbnail, item);
imageListModel->appendRow(item);
}
}