-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathsdwindow.cpp
More file actions
33 lines (27 loc) · 746 Bytes
/
sdwindow.cpp
File metadata and controls
33 lines (27 loc) · 746 Bytes
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
29
30
31
32
33
#include "sdwindow.h"
#include "ui_sdwindow.h"
SDWindow::SDWindow(QStringList files, QWidget *parent) :
QDialog(parent),
ui(new Ui::SDWindow)
{
ui->setupUi(this);
ui->fileslist->setSelectionMode(QListView::SingleSelection);
if(!files.isEmpty())
{
ui->fileslist->addItems(files);
ui->fileslist->setCurrentItem(ui->fileslist->itemAt(0,0));
}
}
SDWindow::~SDWindow()
{
delete ui;
}
void SDWindow::on_buttonBox_accepted()
{
if(ui->fileslist->count() > 0) emit fileSelected(ui->fileslist->currentItem()->text());
}
void SDWindow::on_fileslist_doubleClicked(const QModelIndex &)
{
if(ui->fileslist->count() > 0) emit fileSelected(ui->fileslist->currentItem()->text());
this->close();
}