Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef KLFPATHCHOOSER_H
00026 #define KLFPATHCHOOSER_H
00027
00028 #include <QFrame>
00029 #include <QPushButton>
00030 #include <QLineEdit>
00031
00032 #include <klfdefs.h>
00033
00038 class KLF_EXPORT KLFPathChooser : public QFrame
00039 {
00040 Q_OBJECT
00041
00042
00043 Q_PROPERTY(int mode READ mode WRITE setMode)
00044 Q_PROPERTY(bool dialogConfirmOverwrite READ dialogConfirmOverwrite WRITE setDialogConfirmOverwrite)
00045 Q_PROPERTY(QString caption READ caption WRITE setCaption)
00046 Q_PROPERTY(QString filter READ filter WRITE setFilter)
00047 Q_PROPERTY(QString path READ path WRITE setPath USER true)
00048
00049 Q_PROPERTY(bool possibleOverwriteWasConfirmed READ possibleOverwriteWasConfirmed)
00050
00051 public:
00052 KLFPathChooser(QWidget *parent);
00053 virtual ~KLFPathChooser();
00054
00060 virtual int mode() const { return _mode; }
00061 virtual QString caption() const { return _caption; }
00062 virtual QString filter() const { return _filter; }
00063 virtual QString path() const;
00064
00066 virtual bool dialogConfirmOverwrite() const { return _dlgconfirmoverwrite; }
00067
00082 virtual bool possibleOverwriteWasConfirmed() const { return _pathFromDialog; }
00083
00084 signals:
00085 void fileDialogPathChosen(const QString& fname);
00086
00087 public slots:
00089 virtual void setMode(int mode);
00090 virtual void setCaption(const QString& caption);
00091 virtual void setFilter(const QString& filter);
00092
00098 virtual void setPath(const QString& path);
00099
00109 virtual void setDialogConfirmOverwrite(bool confirm) { _dlgconfirmoverwrite = confirm; }
00110
00111 virtual void requestBrowse();
00112
00113 private slots:
00114 void slotTextChanged();
00115
00116 private:
00117 int _mode;
00118 QString _caption;
00119 QString _filter;
00120 bool _dlgconfirmoverwrite;
00121
00122 bool _pathFromDialog;
00123
00124 QLineEdit *txtPath;
00125 QPushButton *btnBrowse;
00126
00127 QString _selectedfilter;
00128 };
00129
00130 #endif