blob: 662c9e840e75b0c42158f73db92c51242da1fc5d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
#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<ScreenShot*> ScreenshotDialog::selected()
{
QList<ScreenShot*> list;
QList<ScreenShot*> first = m_list->screenshots();
for (QModelIndex index : ui->listView->selectionModel()->selectedIndexes())
{
list.append(first.at(index.row()));
}
return list;
}
|