#include "ScreenshotDialog.h" #include "ui_ScreenshotDialog.h" #include "QModelIndex" ScreenshotDialog::ScreenshotDialog(ScreenshotList *list, QWidget *parent) : QDialog(parent), ui(new Ui::ScreenshotDialog), m_list(list) { ui->setupUi(this); ui->listView->setModel(m_list); } ScreenshotDialog::~ScreenshotDialog() { delete ui; } QList ScreenshotDialog::selected() { QList list; QList first = m_list->screenshots(); for (QModelIndex index : ui->listView->selectionModel()->selectedIndexes()) { list.append(first.at(index.row())); } return list; }