summaryrefslogtreecommitdiffstats
path: root/gui/dialogs/ScreenshotDialog.cpp
blob: 8900f15b073510a3d9013360048634367953761f (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()->selectedRows())
	{
		list.append(first.at(index.row()));
	}
	return list;
}