-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfiledialog.cpp
68 lines (55 loc) · 1.29 KB
/
filedialog.cpp
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#include "filedialog.h"
#include "ui_filedialog.h"
FileDialog::FileDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::FileDialog)
{
ui->setupUi(this);
}
FileDialog::~FileDialog()
{
delete ui;
}
void FileDialog::setParent(QWindow *parent) {
this->parent = parent;
}
void FileDialog::setWindowFlags(Qt::WindowFlags type) {
this->flags = type;
}
void FileDialog::setTitle(QString title) {
this->setWindowTitle(title);
}
void FileDialog::setCurrentDirectory(QUrl directory) {
this->directory = directory;
}
QUrl FileDialog::currentDirectory() {
return this->directory;
}
QList<QUrl> FileDialog::selectedFiles() {
return QList<QUrl>();
}
void FileDialog::on_okButton_clicked()
{
emit clicked(QPlatformDialogHelper::Ok, QPlatformDialogHelper::AcceptRole);
this->close();
}
void FileDialog::on_cancelButton_clicked()
{
emit clicked(QPlatformDialogHelper::Cancel, QPlatformDialogHelper::AcceptRole);
this->close();
}
void FileDialog::show() {
prepareShow();
QDialog::show();
}
int FileDialog::exec() {
prepareShow();
return QDialog::exec();
}
void FileDialog::prepareShow() {
/*if (this->parent != NULL) {
QDialog::setWindowFlags(Qt::FramelessWindowHint | flags);
} else {*/
QDialog::setWindowFlags(flags);
//}
}