Home | All Classes | Main Classes | Annotated | Grouped Classes | Functions |

# Compatibility Members for QFileDialog

The following class members are part of the Qt 3 compatibility layer. They are provided to help you port old code to Qt 4. We strongly advise against using them in new code.

QFileDialog class reference

### Public Functions

- FileMode mode () const
- QString selectedFile () const
- void setDir ( const QString & directory )
- void setDir ( const QDir & directory )
- void setMode ( FileMode m )

### 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 )

## Member Function Documentation

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

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

### 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 ) `[static]`

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

### 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 ) `[static]`

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

### 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 ) `[static]`

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

### FileMode QFileDialog::mode () const

Use fileMode() instead.

### 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.count())
            selected = files[0];

### void QFileDialog::setDir ( const QString & directory )

Use setDirectory() instead.

### void QFileDialog::setDir ( const QDir & directory )

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

Use setDirectory() instead.

### void QFileDialog::setMode ( FileMode m )

Use setFileMode() instead.