-
Notifications
You must be signed in to change notification settings - Fork 0
/
filelistinputwidget.h
61 lines (49 loc) · 1.32 KB
/
filelistinputwidget.h
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
#ifndef FILELISTINPUTWIDGET_H
#define FILELISTINPUTWIDGET_H
#include <QWidget>
namespace Ui {
class FileListInputWidget;
}
class FileListInputWidget : public QWidget
{
Q_OBJECT
public:
explicit FileListInputWidget(QWidget *parent = nullptr);
~FileListInputWidget();
void setDirectoryMode(bool v);
void setVerifyCallBack(std::function<bool(const QString&)> cb) {
verifyCB = cb;
}
void setExistingOnly(bool v) {
isExistingOnly = v;
}
void setFieldName(const QString& name);
QString getFieldName() const {return fieldName;}
void setFilter(const QString& filter) {
this->filter = filter;
}
QString getFilter() const {return filter;}
QStringList getCurrentList() const;
private slots:
void itemMoveUp();
void itemMoveDown();
void itemAdd();
void itemRemove();
public slots:
void addPath(const QString& path);
signals:
void listChanged();
protected:
virtual void dragEnterEvent(QDragEnterEvent *e) override;
virtual void dropEvent(QDropEvent *event) override;
private:
bool isDirectoryMode = false;
bool isExistingOnly = false;
std::function<bool(const QString&)> verifyCB;
QString fieldName;
QString filter;
QString lastAddedPath;
private:
Ui::FileListInputWidget *ui;
};
#endif // FILELISTINPUTWIDGET_H