Last change
on this file since 9158 was 8252, checked in by stoecker, 7 years ago |
see #105 - reenable Qt4 build options, drop generic version dependend includes, replace by direct requirements, remaining QtCore lines should also be replaced
|
File size:
796 bytes
|
Line | |
---|
1 |
|
---|
2 | #ifndef QTFILECHOOSER
|
---|
3 | #define QTFILECHOOSER
|
---|
4 |
|
---|
5 | #include <QLineEdit>
|
---|
6 | #include <QPushButton>
|
---|
7 | #include <QWidget>
|
---|
8 |
|
---|
9 | class qtFileChooser : public QWidget {
|
---|
10 | Q_OBJECT
|
---|
11 |
|
---|
12 | Q_ENUMS( Mode )
|
---|
13 | Q_PROPERTY( Mode mode READ mode WRITE setMode )
|
---|
14 | Q_PROPERTY( QString fileName READ fileName WRITE setFileName )
|
---|
15 |
|
---|
16 | public:
|
---|
17 | enum Mode {File, Files, Directory};
|
---|
18 |
|
---|
19 | qtFileChooser(QWidget* parent = 0, qtFileChooser::Mode mode = File);
|
---|
20 | ~qtFileChooser();
|
---|
21 |
|
---|
22 | QString fileName() const;
|
---|
23 | Mode mode() const {return _mode;}
|
---|
24 |
|
---|
25 | public slots:
|
---|
26 | void setFileName(const QString& fileName);
|
---|
27 | void setMode(Mode mode) {_mode = mode;}
|
---|
28 |
|
---|
29 | signals:
|
---|
30 | void fileNameChanged(const QString&);
|
---|
31 |
|
---|
32 | private slots:
|
---|
33 | void chooseFile();
|
---|
34 |
|
---|
35 | private:
|
---|
36 | QLineEdit* _lineEdit;
|
---|
37 | QPushButton* _button;
|
---|
38 | Mode _mode;
|
---|
39 |
|
---|
40 | };
|
---|
41 | #endif
|
---|
Note:
See
TracBrowser
for help on using the repository browser.