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
00026 #ifndef SUIT_FILEDLG_H
00027 #define SUIT_FILEDLG_H
00028
00029 #include "SUIT.h"
00030
00031 #include <QFileDialog>
00032
00033 class QLabel;
00034 class QLineEdit;
00035 class QComboBox;
00036 class QPushButton;
00037 class QUrl;
00038 class SUIT_FileValidator;
00039
00040 class SUIT_EXPORT SUIT_FileDlg : public QFileDialog
00041 {
00042 Q_OBJECT
00043
00044 public:
00045 SUIT_FileDlg( QWidget*, bool, bool = true, bool = true );
00046 virtual ~SUIT_FileDlg();
00047
00048 bool isOpenDlg() const;
00049
00050 bool checkPermissions() const;
00051 void setCheckPermissions( const bool );
00052
00053 SUIT_FileValidator* validator() const;
00054 void setValidator( SUIT_FileValidator* );
00055
00056 bool addWidgets( QWidget*, QWidget*, QWidget* );
00057
00058 QStringList selectedFiles() const;
00059 QString selectedFile() const;
00060
00061 void selectFile( const QString& );
00062
00063 static QString getLastVisitedDirectory();
00064
00065 static QString getFileName( QWidget*,
00066 const QString&,
00067 const QStringList&,
00068 const QString& = QString(),
00069 const bool = true,
00070 const bool = true,
00071 SUIT_FileValidator* = 0 );
00072 static QString getFileName( QWidget*,
00073 const QString&,
00074 const QString&,
00075 const QString& = QString(),
00076 const bool = true,
00077 const bool = true,
00078 SUIT_FileValidator* = 0 );
00079
00080 static QStringList getOpenFileNames( QWidget*,
00081 const QString&,
00082 const QStringList&,
00083 const QString& = QString(),
00084 const bool = true,
00085 SUIT_FileValidator* = 0 );
00086 static QStringList getOpenFileNames( QWidget*,
00087 const QString&,
00088 const QString&,
00089 const QString& = QString(),
00090 const bool = true,
00091 SUIT_FileValidator* = 0 );
00092
00093 static QString getExistingDirectory( QWidget*,
00094 const QString&,
00095 const QString& = QString(),
00096 const bool = true,
00097 SUIT_FileValidator* = 0 );
00098
00099 static QString getLastVisitedPath();
00100
00101 protected:
00102 virtual bool event( QEvent* );
00103 QLineEdit* lineEdit() const;
00104 virtual bool acceptData();
00105 QString addExtension( const QString& ) const;
00106 bool processPath( const QString& );
00107 void addFilter( const QString& );
00108 static bool hasWildCards( const QString& );
00109
00110 protected slots:
00111 void accept();
00112 void quickDir( const QString& );
00113 void addQuickDir();
00114
00115 private:
00116 void polish();
00117
00118 private:
00119 SUIT_FileValidator* myValidator;
00120 QLabel* myQuickLab;
00121 QComboBox* myQuickCombo;
00122 QList<QUrl> myUrls;
00123 QPushButton* myQuickButton;
00124 bool myCheckPermissions;
00125 static QString myLastVisitedPath;
00126 };
00127
00128 #endif // SUIT_FILEDLG_H