2014-02-23 21:14:24 +00:00
|
|
|
#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();
|
2014-02-24 00:45:59 +00:00
|
|
|
for (QModelIndex index : ui->listView->selectionModel()->selectedRows())
|
2014-02-23 21:14:24 +00:00
|
|
|
{
|
|
|
|
list.append(first.at(index.row()));
|
|
|
|
}
|
|
|
|
return list;
|
|
|
|
}
|