Compatibility Members for QFileDialog

The following members of class QFileDialogare part of the Qt compatibility layer. We advise against using them in new code.

Public Functions

FileMode mode() const
QString selectedFile() const
void setDir(const QString & directory)
void setDir(const QDir & directory)
void setMode(FileMode m)
  • 57 public functions inherited from QWidget
  • 8 public functions inherited from QObject
  • 8 public functions inherited from QPaintDevice

Static Public Members

QString getExistingDirectory(const QString & dir, QWidget * parent = 0, const char * name = 0, const QString & caption = QString(), bool dirOnly = true, bool resolveSymlinks = true)
QString getOpenFileName(const QString & dir, const QString & filter = QString(), QWidget * parent = 0, const char * name = 0, const QString & caption = QString(), QString * selectedFilter = 0, bool resolveSymlinks = true)
QStringList getOpenFileNames(const QString & filter, const QString & dir = QString(), QWidget * parent = 0, const char * name = 0, const QString & caption = QString(), QString * selectedFilter = 0, bool resolveSymlinks = true)
QString getSaveFileName(const QString & dir, const QString & filter = QString(), QWidget * parent = 0, const char * name = 0, const QString & caption = QString(), QString * selectedFilter = 0, bool resolveSymlinks = true)
  • 1 static public member inherited from QWidget
  • 13 static public members inherited from QPaintDevice

Member Function Documentation

[static] QString QFileDialog::getExistingDirectory(const QString & dir, QWidget * parent = 0, const char * name = 0, const QString & caption = QString(), bool dirOnly = true, bool resolveSymlinks = true)

Use the getExistingDirectory() overload that takes parent as the first argument instead.

[static] QString QFileDialog::getOpenFileName(const QString & dir, const QString & filter = QString(), QWidget * parent = 0, const char * name = 0, const QString & caption = QString(), QString * selectedFilter = 0, bool resolveSymlinks = true)

Use the getOpenFileName() overload that takes parent as the first argument instead.

[static] QStringList QFileDialog::getOpenFileNames(const QString & filter, const QString & dir = QString(), QWidget * parent = 0, const char * name = 0, const QString & caption = QString(), QString * selectedFilter = 0, bool resolveSymlinks = true)

Use the getOpenFileNames() overload that takes parent as the first argument instead.

[static] QString QFileDialog::getSaveFileName(const QString & dir, const QString & filter = QString(), QWidget * parent = 0, const char * name = 0, const QString & caption = QString(), QString * selectedFilter = 0, bool resolveSymlinks = true)

Use the getSaveFileName() overload that takes parent as the first argument instead.

FileMode QFileDialog::mode() const

Use fileMode() instead.

See also setMode().

QString QFileDialog::selectedFile() const

Use selectedFiles() instead.

For example, if you have code like

QString selected = dialog->selectedFile();

you can rewrite it as

 QStringList files = dialog->selectedFiles();
 QString selected;
 if (!files.isEmpty())
     selected = files[0];

void QFileDialog::setDir(const QString & directory)

Use setDirectory() instead.

void QFileDialog::setDir(const QDir & directory)

Use setDirectory() instead.

void QFileDialog::setMode(FileMode m)

Use setFileMode() instead.

See also mode().

© 2016 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.