55 #ifndef QT_NO_FILEDIALOG
59 struct QFileDialogArgs;
61 class QFileDialogPrivate;
74 Q_PROPERTY(
bool readOnly READ isReadOnly WRITE setReadOnly DESIGNABLE false)
75 Q_PROPERTY(
bool resolveSymlinks READ resolveSymlinks WRITE setResolveSymlinks DESIGNABLE false)
76 Q_PROPERTY(
bool confirmOverwrite READ confirmOverwrite WRITE setConfirmOverwrite DESIGNABLE false)
78 Q_PROPERTY(
bool nameFilterDetailsVisible READ isNameFilterDetailsVisible
79 WRITE setNameFilterDetailsVisible DESIGNABLE false)
80 Q_PROPERTY(Options options READ options WRITE setOptions)
84 enum FileMode { AnyFile, ExistingFile, Directory, ExistingFiles, DirectoryOnly };
86 enum DialogLabel { LookIn, FileName, FileType, Accept, Reject };
91 ShowDirsOnly = 0x00000001,
92 DontResolveSymlinks = 0x00000002,
93 DontConfirmOverwrite = 0x00000004,
94 DontUseSheet = 0x00000008,
95 DontUseNativeDialog = 0x00000010,
96 ReadOnly = 0x00000020,
97 HideNameFilterDetails = 0x00000040,
98 DontUseCustomDirectoryIcons = 0x00000080
100 Q_DECLARE_FLAGS(Options, Option)
105 const QString &directory = QString(),
106 const QString &
filter = QString());
109 void setDirectory(const QString &directory);
110 inline void setDirectory(const
QDir &directory);
111 QDir directory() const;
113 void selectFile(const QString &filename);
117 QT_DEPRECATED
void setFilter(
const QString &
filter);
118 QT_DEPRECATED
void setFilters(
const QStringList &filters);
120 QT_DEPRECATED
void selectFilter(
const QString &
filter);
121 QT_DEPRECATED QString selectedFilter()
const;
123 void setNameFilterDetailsVisible(
bool enabled);
124 bool isNameFilterDetailsVisible()
const;
126 void setNameFilter(
const QString &
filter);
129 void selectNameFilter(
const QString &
filter);
130 QString selectedNameFilter()
const;
132 QDir::Filters
filter()
const;
133 void setFilter(QDir::Filters filters);
135 void setViewMode(ViewMode
mode);
136 ViewMode viewMode()
const;
138 void setFileMode(FileMode
mode);
139 FileMode fileMode()
const;
141 void setAcceptMode(AcceptMode
mode);
142 AcceptMode acceptMode()
const;
144 void setReadOnly(
bool enabled);
145 bool isReadOnly()
const;
147 void setResolveSymlinks(
bool enabled);
148 bool resolveSymlinks()
const;
156 void setConfirmOverwrite(
bool enabled);
157 bool confirmOverwrite()
const;
159 void setDefaultSuffix(
const QString &suffix);
160 QString defaultSuffix()
const;
171 void setLabelText(DialogLabel label,
const QString &text);
172 QString labelText(DialogLabel label)
const;
174 #ifndef QT_NO_PROXYMODEL
179 void setOption(Option option,
bool on =
true);
180 bool testOption(Option option)
const;
181 void setOptions(Options options);
182 Options options()
const;
184 #ifdef Q_NO_USING_KEYWORD
195 void fileSelected(
const QString &file);
197 void currentChanged(
const QString &path);
198 void directoryEntered(
const QString &directory);
199 void filterSelected(
const QString &
filter);
203 typedef FileMode Mode;
204 inline QT3_SUPPORT
void setMode(FileMode m) { setFileMode(m); }
205 inline QT3_SUPPORT FileMode
mode()
const {
return fileMode(); }
206 inline QT3_SUPPORT
void setDir(
const QString &directory) { setDirectory(directory); }
207 inline QT3_SUPPORT
void setDir(
const QDir &directory ) { setDirectory(directory); }
208 QT3_SUPPORT QString selectedFile()
const;
211 static QString getOpenFileName(
QWidget *parent = 0,
212 const QString &caption = QString(),
213 const QString &dir = QString(),
214 const QString &
filter = QString(),
215 QString *selectedFilter = 0,
216 Options options = 0);
218 static QString getSaveFileName(
QWidget *parent = 0,
219 const QString &caption = QString(),
220 const QString &dir = QString(),
221 const QString &
filter = QString(),
222 QString *selectedFilter = 0,
223 Options options = 0);
225 static QString getExistingDirectory(
QWidget *parent = 0,
226 const QString &caption = QString(),
227 const QString &dir = QString(),
228 Options options = ShowDirsOnly);
231 const QString &caption = QString(),
232 const QString &dir = QString(),
233 const QString &
filter = QString(),
234 QString *selectedFilter = 0,
235 Options options = 0);
238 inline static QString QT3_SUPPORT getOpenFileName(
const QString &dir,
239 const QString &
filter = QString(),
241 const QString &caption = QString(),
242 QString *selectedFilter = 0,
243 bool resolveSymlinks =
true)
245 return getOpenFileName(parent, caption, dir,
filter, selectedFilter,
246 resolveSymlinks ? Option(0) : DontResolveSymlinks); }
248 inline static QString QT3_SUPPORT getSaveFileName(
const QString &dir,
249 const QString &
filter = QString(),
251 const QString &caption = QString(),
252 QString *selectedFilter = 0,
253 bool resolveSymlinks =
true)
255 return getSaveFileName(parent, caption, dir,
filter, selectedFilter,
256 resolveSymlinks ? Option(0) : DontResolveSymlinks); }
258 inline static QString QT3_SUPPORT getExistingDirectory(
const QString &dir,
260 const char*
name = 0,
261 const QString &caption = QString(),
263 bool resolveSymlinks =
true)
265 return getExistingDirectory(parent, caption, dir,
266 Options((resolveSymlinks ? Option(0) : DontResolveSymlinks)
267 | (dirOnly ? ShowDirsOnly : Option(0)))); }
270 const QString &dir = QString(),
272 const char*
name = 0,
273 const QString &caption = QString(),
274 QString *selectedFilter = 0,
275 bool resolveSymlinks =
true)
277 return getOpenFileNames(parent, caption, dir, filter, selectedFilter,
278 resolveSymlinks ? Option(0) : DontResolveSymlinks); }
279 #endif // QT3_SUPPORT
283 void done(
int result);
306 Q_PRIVATE_SLOT(d_func(),
void _q_goToDirectory(const QString &path))
312 Q_PRIVATE_SLOT(d_func(),
void _q_autoCompleteFileName(const QString &text))
315 const QString oldName, const QString newName))
316 #if defined(Q_WS_MAC)
324 Q_DECLARE_OPERATORS_FOR_FLAGS(QFileDialog::Options)
326 #endif // QT_NO_FILEDIALOG
332 #endif // QFILEDIALOG_H
void setVisible(bool visible)
GLXDrawable GLXDrawable member
#define Q_PRIVATE_SLOT(d, signature)
#define QT_BEGIN_NAMESPACE
void setDirectory(const QString &directory)
QString absolutePath() const
GLuint const GLchar * name