-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathfileinput.h
More file actions
46 lines (32 loc) · 804 Bytes
/
fileinput.h
File metadata and controls
46 lines (32 loc) · 804 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
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef FILEINPUT_H
#define FILEINPUT_H
#include <QWidget>
#include <QLineEdit>
#include <QPushButton>
class FileInput : public QWidget
{
Q_OBJECT
public:
enum FileInputMode { DirectoryMode, FileOpenMode, FileSaveMode };
Q_DECLARE_FLAGS(FileInputModes, FileInputMode)
public:
explicit FileInput(FileInputMode mode, QWidget *parent = 0);
QString value();
bool isEmpty();
bool isReadableDir();
bool isWritableFile();
QString dialog_caption;
QString dialog_dir;
QString dialog_filter;
signals:
void valueChanged();
public slots:
void setValue(QString text);
void browse();
private:
FileInputMode _mode;
QLineEdit *_text;
QPushButton *_browse;
};
Q_DECLARE_OPERATORS_FOR_FLAGS(FileInput::FileInputModes)
#endif // FILEINPUT_H