Rev | Line | |
---|
[3601] | 1 |
|
---|
| 2 | #ifndef QTFILECHOOSER
|
---|
| 3 | #define QTFILECHOOSER
|
---|
| 4 |
|
---|
| 5 | #include <QtGui>
|
---|
| 6 |
|
---|
| 7 | class qtFileChooser : public QWidget {
|
---|
| 8 | Q_OBJECT
|
---|
| 9 |
|
---|
| 10 | Q_ENUMS( Mode )
|
---|
| 11 | Q_PROPERTY( Mode mode READ mode WRITE setMode )
|
---|
| 12 | Q_PROPERTY( QString fileName READ fileName WRITE setFileName )
|
---|
| 13 |
|
---|
| 14 | public:
|
---|
| 15 | qtFileChooser(QWidget* parent = 0);
|
---|
| 16 | ~qtFileChooser();
|
---|
| 17 |
|
---|
| 18 | enum Mode {File, Directory};
|
---|
| 19 |
|
---|
| 20 | QString fileName() const;
|
---|
| 21 | Mode mode() const {return _mode;}
|
---|
| 22 |
|
---|
| 23 | public slots:
|
---|
| 24 | void setFileName(const QString& fileName);
|
---|
| 25 | void setMode(Mode mode) {_mode = mode;}
|
---|
| 26 |
|
---|
| 27 | signals:
|
---|
| 28 | void fileNameChanged(const QString&);
|
---|
| 29 |
|
---|
| 30 | private slots:
|
---|
| 31 | void chooseFile();
|
---|
| 32 |
|
---|
| 33 | private:
|
---|
| 34 | QLineEdit* _lineEdit;
|
---|
| 35 | QPushButton* _button;
|
---|
| 36 | Mode _mode;
|
---|
| 37 |
|
---|
| 38 | };
|
---|
| 39 | #endif
|
---|
Note:
See
TracBrowser
for help on using the repository browser.