Sophie

Sophie

distrib > Mageia > 6 > armv5tl > media > core-updates > by-pkgid > 768f7d9f703884aa2562bf0a651086df > files > 3280

qtbase5-doc-5.9.4-1.1.mga6.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qfiledialog.cpp -->
  <title>QFileDialog Class | Qt Widgets 5.9</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td >Qt 5.9</td><td ><a href="qtwidgets-index.html">Qt Widgets</a></td><td ><a href="qtwidgets-module.html">C++ Classes</a></td><td >QFileDialog</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right">Qt 5.9.4 Reference Documentation</td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-types">Public Types</a></li>
<li class="level1"><a href="#properties">Properties</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#reimplemented-public-functions">Reimplemented Public Functions</a></li>
<li class="level1"><a href="#signals">Signals</a></li>
<li class="level1"><a href="#static-public-members">Static Public Members</a></li>
<li class="level1"><a href="#reimplemented-protected-functions">Reimplemented Protected Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">QFileDialog Class</h1>
<!-- $$$QFileDialog-brief -->
<p>The <a href="qfiledialog.html">QFileDialog</a> class provides a dialog that allow users to select files or directories. <a href="#details">More...</a></p>
<!-- @@@QFileDialog -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QFileDialog&gt;</span>
</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += widgets</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherits:</td><td class="memItemRight bottomAlign"> <a href="qdialog.html">QDialog</a></td></tr></table></div><ul>
<li><a href="qfiledialog-members.html">List of all members, including inherited members</a></li>
<li><a href="qfiledialog-obsolete.html">Obsolete members</a></li>
</ul>
<a name="public-types"></a>
<h2 id="public-types">Public Types</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#AcceptMode-enum">AcceptMode</a></b> { AcceptOpen, AcceptSave }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#DialogLabel-enum">DialogLabel</a></b> { LookIn, FileName, FileType, Accept, Reject }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#FileMode-enum">FileMode</a></b> { AnyFile, ExistingFile, Directory, ExistingFiles, DirectoryOnly }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#Option-enum">Option</a></b> { ShowDirsOnly, DontResolveSymlinks, DontConfirmOverwrite, DontUseNativeDialog, ..., DontUseCustomDirectoryIcons }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> flags </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#Option-enum">Options</a></b></td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#ViewMode-enum">ViewMode</a></b> { Detail, List }</td></tr>
</table></div>
<a name="properties"></a>
<h2 id="properties">Properties</h2>
<div class="table"><table class="propsummary">
<tr><td class="topAlign"><ul>
<li class="fn"><b><a href="qfiledialog.html#acceptMode-prop">acceptMode</a></b> : AcceptMode</li>
<li class="fn"><b><a href="qfiledialog.html#defaultSuffix-prop">defaultSuffix</a></b> : QString</li>
<li class="fn"><b><a href="qfiledialog.html#fileMode-prop">fileMode</a></b> : FileMode</li>
</ul></td><td class="topAlign"><ul>
<li class="fn"><b><a href="qfiledialog.html#options-prop">options</a></b> : Options</li>
<li class="fn"><b><a href="qfiledialog.html#supportedSchemes-prop">supportedSchemes</a></b> : QStringList</li>
<li class="fn"><b><a href="qfiledialog.html#viewMode-prop">viewMode</a></b> : ViewMode</li>
</ul>
</td></tr>
</table></div>
<ul>
<li class="fn">2 properties inherited from <a href="qdialog.html#properties">QDialog</a></li>
<li class="fn">59 properties inherited from <a href="qwidget.html#properties">QWidget</a></li>
<li class="fn">1 property inherited from <a href="../qtcore/qobject.html#properties">QObject</a></li>
</ul>
<a name="public-functions"></a>
<h2 id="public-functions">Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#QFileDialog">QFileDialog</a></b>(QWidget *<i>parent</i>, Qt::WindowFlags <i>flags</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#QFileDialog-1">QFileDialog</a></b>(QWidget *<i>parent</i> = Q_NULLPTR, const QString &amp;<i>caption</i> = QString(), const QString &amp;<i>directory</i> = QString(), const QString &amp;<i>filter</i> = QString())</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#dtor.QFileDialog">~QFileDialog</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> AcceptMode </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#acceptMode-prop">acceptMode</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#defaultSuffix-prop">defaultSuffix</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDir </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#directory">directory</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QUrl </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#directoryUrl">directoryUrl</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> FileMode </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#fileMode-prop">fileMode</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDir::Filters </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#filter">filter</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QStringList </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#history">history</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QFileIconProvider *</td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#iconProvider">iconProvider</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QAbstractItemDelegate *</td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#itemDelegate">itemDelegate</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#labelText">labelText</a></b>(DialogLabel <i>label</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QStringList </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#mimeTypeFilters">mimeTypeFilters</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QStringList </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#nameFilters">nameFilters</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#open">open</a></b>(QObject *<i>receiver</i>, const char *<i>member</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Options </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#options-prop">options</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QAbstractProxyModel *</td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#proxyModel">proxyModel</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#restoreState">restoreState</a></b>(const QByteArray &amp;<i>state</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#saveState">saveState</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#selectFile">selectFile</a></b>(const QString &amp;<i>filename</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#selectMimeTypeFilter">selectMimeTypeFilter</a></b>(const QString &amp;<i>filter</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#selectNameFilter">selectNameFilter</a></b>(const QString &amp;<i>filter</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#selectUrl">selectUrl</a></b>(const QUrl &amp;<i>url</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QStringList </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#selectedFiles">selectedFiles</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#selectedMimeTypeFilter">selectedMimeTypeFilter</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#selectedNameFilter">selectedNameFilter</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QList&lt;QUrl&gt; </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#selectedUrls">selectedUrls</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#acceptMode-prop">setAcceptMode</a></b>(AcceptMode <i>mode</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#defaultSuffix-prop">setDefaultSuffix</a></b>(const QString &amp;<i>suffix</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#setDirectory">setDirectory</a></b>(const QString &amp;<i>directory</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#setDirectory-1">setDirectory</a></b>(const QDir &amp;<i>directory</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#setDirectoryUrl">setDirectoryUrl</a></b>(const QUrl &amp;<i>directory</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#fileMode-prop">setFileMode</a></b>(FileMode <i>mode</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#setFilter">setFilter</a></b>(QDir::Filters <i>filters</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#setHistory">setHistory</a></b>(const QStringList &amp;<i>paths</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#setIconProvider">setIconProvider</a></b>(QFileIconProvider *<i>provider</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#setItemDelegate">setItemDelegate</a></b>(QAbstractItemDelegate *<i>delegate</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#setLabelText">setLabelText</a></b>(DialogLabel <i>label</i>, const QString &amp;<i>text</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#setMimeTypeFilters">setMimeTypeFilters</a></b>(const QStringList &amp;<i>filters</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#setNameFilter">setNameFilter</a></b>(const QString &amp;<i>filter</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#setNameFilters">setNameFilters</a></b>(const QStringList &amp;<i>filters</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#setOption">setOption</a></b>(Option <i>option</i>, bool <i>on</i> = true)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#options-prop">setOptions</a></b>(Options <i>options</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#setProxyModel">setProxyModel</a></b>(QAbstractProxyModel *<i>proxyModel</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#setSidebarUrls">setSidebarUrls</a></b>(const QList&lt;QUrl&gt; &amp;<i>urls</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#supportedSchemes-prop">setSupportedSchemes</a></b>(const QStringList &amp;<i>schemes</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#viewMode-prop">setViewMode</a></b>(ViewMode <i>mode</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QList&lt;QUrl&gt; </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#sidebarUrls">sidebarUrls</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QStringList </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#supportedSchemes-prop">supportedSchemes</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#testOption">testOption</a></b>(Option <i>option</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> ViewMode </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#viewMode-prop">viewMode</a></b>() const</td></tr>
</table></div>
<a name="reimplemented-public-functions"></a>
<h2 id="reimplemented-public-functions">Reimplemented Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#setVisible">setVisible</a></b>(bool <i>visible</i>)</td></tr>
</table></div>
<ul>
<li class="fn">8 public functions inherited from <a href="qdialog.html#public-functions">QDialog</a></li>
<li class="fn">214 public functions inherited from <a href="qwidget.html#public-functions">QWidget</a></li>
<li class="fn">32 public functions inherited from <a href="../qtcore/qobject.html#public-functions">QObject</a></li>
<li class="fn">14 public functions inherited from <a href="../qtgui/qpaintdevice.html#public-functions">QPaintDevice</a></li>
</ul>
<a name="signals"></a>
<h2 id="signals">Signals</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#currentChanged">currentChanged</a></b>(const QString &amp;<i>path</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#currentUrlChanged">currentUrlChanged</a></b>(const QUrl &amp;<i>url</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#directoryEntered">directoryEntered</a></b>(const QString &amp;<i>directory</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#directoryUrlEntered">directoryUrlEntered</a></b>(const QUrl &amp;<i>directory</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#fileSelected">fileSelected</a></b>(const QString &amp;<i>file</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#filesSelected">filesSelected</a></b>(const QStringList &amp;<i>selected</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#filterSelected">filterSelected</a></b>(const QString &amp;<i>filter</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#urlSelected">urlSelected</a></b>(const QUrl &amp;<i>url</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#urlsSelected">urlsSelected</a></b>(const QList&lt;QUrl&gt; &amp;<i>urls</i>)</td></tr>
</table></div>
<ul>
<li class="fn">3 signals inherited from <a href="qdialog.html#signals">QDialog</a></li>
<li class="fn">3 signals inherited from <a href="qwidget.html#signals">QWidget</a></li>
<li class="fn">2 signals inherited from <a href="../qtcore/qobject.html#signals">QObject</a></li>
</ul>
<a name="static-public-members"></a>
<h2 id="static-public-members">Static Public Members</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#getExistingDirectory">getExistingDirectory</a></b>(QWidget *<i>parent</i> = Q_NULLPTR, const QString &amp;<i>caption</i> = QString(), const QString &amp;<i>dir</i> = QString(), Options <i>options</i> = ShowDirsOnly)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QUrl </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#getExistingDirectoryUrl">getExistingDirectoryUrl</a></b>(QWidget *<i>parent</i> = Q_NULLPTR, const QString &amp;<i>caption</i> = QString(), const QUrl &amp;<i>dir</i> = QUrl(), Options <i>options</i> = ShowDirsOnly, const QStringList &amp;<i>supportedSchemes</i> = QStringList())</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#getOpenFileName">getOpenFileName</a></b>(QWidget *<i>parent</i> = Q_NULLPTR, const QString &amp;<i>caption</i> = QString(), const QString &amp;<i>dir</i> = QString(), const QString &amp;<i>filter</i> = QString(), QString *<i>selectedFilter</i> = Q_NULLPTR, Options <i>options</i> = Options())</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QStringList </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#getOpenFileNames">getOpenFileNames</a></b>(QWidget *<i>parent</i> = Q_NULLPTR, const QString &amp;<i>caption</i> = QString(), const QString &amp;<i>dir</i> = QString(), const QString &amp;<i>filter</i> = QString(), QString *<i>selectedFilter</i> = Q_NULLPTR, Options <i>options</i> = Options())</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QUrl </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#getOpenFileUrl">getOpenFileUrl</a></b>(QWidget *<i>parent</i> = Q_NULLPTR, const QString &amp;<i>caption</i> = QString(), const QUrl &amp;<i>dir</i> = QUrl(), const QString &amp;<i>filter</i> = QString(), QString *<i>selectedFilter</i> = Q_NULLPTR, Options <i>options</i> = Options(), const QStringList &amp;<i>supportedSchemes</i> = QStringList())</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QList&lt;QUrl&gt; </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#getOpenFileUrls">getOpenFileUrls</a></b>(QWidget *<i>parent</i> = Q_NULLPTR, const QString &amp;<i>caption</i> = QString(), const QUrl &amp;<i>dir</i> = QUrl(), const QString &amp;<i>filter</i> = QString(), QString *<i>selectedFilter</i> = Q_NULLPTR, Options <i>options</i> = Options(), const QStringList &amp;<i>supportedSchemes</i> = QStringList())</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#getSaveFileName">getSaveFileName</a></b>(QWidget *<i>parent</i> = Q_NULLPTR, const QString &amp;<i>caption</i> = QString(), const QString &amp;<i>dir</i> = QString(), const QString &amp;<i>filter</i> = QString(), QString *<i>selectedFilter</i> = Q_NULLPTR, Options <i>options</i> = Options())</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QUrl </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#getSaveFileUrl">getSaveFileUrl</a></b>(QWidget *<i>parent</i> = Q_NULLPTR, const QString &amp;<i>caption</i> = QString(), const QUrl &amp;<i>dir</i> = QUrl(), const QString &amp;<i>filter</i> = QString(), QString *<i>selectedFilter</i> = Q_NULLPTR, Options <i>options</i> = Options(), const QStringList &amp;<i>supportedSchemes</i> = QStringList())</td></tr>
</table></div>
<ul>
<li class="fn">5 static public members inherited from <a href="qwidget.html#static-public-members">QWidget</a></li>
<li class="fn">10 static public members inherited from <a href="../qtcore/qobject.html#static-public-members">QObject</a></li>
</ul>
<a name="reimplemented-protected-functions"></a>
<h2 id="reimplemented-protected-functions">Reimplemented Protected Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#accept">accept</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#changeEvent">changeEvent</a></b>(QEvent *<i>e</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qfiledialog.html#done">done</a></b>(int <i>result</i>)</td></tr>
</table></div>
<ul>
<li class="fn">6 protected functions inherited from <a href="qdialog.html#protected-functions">QDialog</a></li>
<li class="fn">35 protected functions inherited from <a href="qwidget.html#protected-functions">QWidget</a></li>
<li class="fn">9 protected functions inherited from <a href="../qtcore/qobject.html#protected-functions">QObject</a></li>
<li class="fn">1 protected function inherited from <a href="../qtgui/qpaintdevice.html#protected-functions">QPaintDevice</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li class="fn">5 public slots inherited from <a href="qdialog.html#public-slots">QDialog</a></li>
<li class="fn">19 public slots inherited from <a href="qwidget.html#public-slots">QWidget</a></li>
<li class="fn">1 public slot inherited from <a href="../qtcore/qobject.html#public-slots">QObject</a></li>
<li class="fn">1 public variable inherited from <a href="../qtcore/qobject.html#public-variables">QObject</a></li>
<li class="fn">6 protected functions inherited from <a href="qdialog.html#protected-functions">QDialog</a></li>
<li class="fn">35 protected functions inherited from <a href="qwidget.html#protected-functions">QWidget</a></li>
<li class="fn">9 protected functions inherited from <a href="../qtcore/qobject.html#protected-functions">QObject</a></li>
<li class="fn">1 protected function inherited from <a href="../qtgui/qpaintdevice.html#protected-functions">QPaintDevice</a></li>
<li class="fn">1 protected slot inherited from <a href="qwidget.html#protected-slots">QWidget</a></li>
<li class="fn">2 protected variables inherited from <a href="../qtcore/qobject.html#protected-variables">QObject</a></li>
<li class="fn">1 protected type inherited from <a href="../qtgui/qpaintdevice.html#protected-variables">QPaintDevice</a></li>
</ul>
<a name="details"></a>
<!-- $$$QFileDialog-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>The <a href="qfiledialog.html">QFileDialog</a> class provides a dialog that allow users to select files or directories.</p>
<p>The <a href="qfiledialog.html">QFileDialog</a> class enables a user to traverse the file system in order to select one or many files or a directory.</p>
<p>The easiest way to create a <a href="qfiledialog.html">QFileDialog</a> is to use the static functions.</p>
<pre class="cpp">

  fileName <span class="operator">=</span> <span class="type"><a href="qfiledialog.html#QFileDialog">QFileDialog</a></span><span class="operator">::</span>getOpenFileName(<span class="keyword">this</span><span class="operator">,</span>
      tr(<span class="string">&quot;Open Image&quot;</span>)<span class="operator">,</span> <span class="string">&quot;/home/jana&quot;</span><span class="operator">,</span> tr(<span class="string">&quot;Image Files (*.png *.jpg *.bmp)&quot;</span>));

</pre>
<p>In the above example, a modal <a href="qfiledialog.html">QFileDialog</a> is created using a static function. The dialog initially displays the contents of the &quot;/home/jana&quot; directory, and displays files matching the patterns given in the string &quot;Image Files (*.png *.jpg *.bmp)&quot;. The parent of the file dialog is set to <i>this</i>, and the window title is set to &quot;Open Image&quot;.</p>
<p>If you want to use multiple filters, separate each one with <i>two</i> semicolons. For example:</p>
<pre class="cpp">

  <span class="string">&quot;Images (*.png *.xpm *.jpg);;Text files (*.txt);;XML files (*.xml)&quot;</span>

</pre>
<p>You can create your own <a href="qfiledialog.html">QFileDialog</a> without using the static functions. By calling <a href="qfiledialog.html#fileMode-prop">setFileMode</a>(), you can specify what the user must select in the dialog:</p>
<pre class="cpp">

  <span class="type"><a href="qfiledialog.html#QFileDialog">QFileDialog</a></span> dialog(<span class="keyword">this</span>);
  dialog<span class="operator">.</span>setFileMode(<span class="type"><a href="qfiledialog.html#QFileDialog">QFileDialog</a></span><span class="operator">::</span>AnyFile);

</pre>
<p>In the above example, the mode of the file dialog is set to <a href="qfiledialog.html#FileMode-enum">AnyFile</a>, meaning that the user can select any file, or even specify a file that doesn't exist. This mode is useful for creating a &quot;Save As&quot; file dialog. Use <a href="qfiledialog.html#FileMode-enum">ExistingFile</a> if the user must select an existing file, or <a href="qfiledialog.html#FileMode-enum">Directory</a> if only a directory may be selected. See the <a href="qfiledialog.html#FileMode-enum">QFileDialog::FileMode</a> enum for the complete list of modes.</p>
<p>The <a href="qfiledialog.html#fileMode-prop">fileMode</a> property contains the mode of operation for the dialog; this indicates what types of objects the user is expected to select. Use <a href="qfiledialog.html#setNameFilter">setNameFilter</a>() to set the dialog's file filter. For example:</p>
<pre class="cpp">

  dialog<span class="operator">.</span>setNameFilter(tr(<span class="string">&quot;Images (*.png *.xpm *.jpg)&quot;</span>));

</pre>
<p>In the above example, the filter is set to <code>&quot;Images (*.png *.xpm *.jpg)&quot;</code>, this means that only files with the extension <code>png</code>, <code>xpm</code>, or <code>jpg</code> will be shown in the <a href="qfiledialog.html">QFileDialog</a>. You can apply several filters by using <a href="qfiledialog.html#setNameFilters">setNameFilters</a>(). Use <a href="qfiledialog.html#selectNameFilter">selectNameFilter</a>() to select one of the filters you've given as the file dialog's default filter.</p>
<p>The file dialog has two view modes: <a href="qfiledialog.html#ViewMode-enum">List</a> and <a href="qfiledialog.html#ViewMode-enum">Detail</a>. <a href="qfiledialog.html#ViewMode-enum">List</a> presents the contents of the current directory as a list of file and directory names. <a href="qfiledialog.html#ViewMode-enum">Detail</a> also displays a list of file and directory names, but provides additional information alongside each name, such as the file size and modification date. Set the mode with <a href="qfiledialog.html#viewMode-prop">setViewMode</a>():</p>
<pre class="cpp">

  dialog<span class="operator">.</span>setViewMode(<span class="type"><a href="qfiledialog.html#QFileDialog">QFileDialog</a></span><span class="operator">::</span>Detail);

</pre>
<p>The last important function you will need to use when creating your own file dialog is <a href="qfiledialog.html#selectedFiles">selectedFiles</a>().</p>
<pre class="cpp">

  <span class="type"><a href="../qtcore/qstringlist.html">QStringList</a></span> fileNames;
  <span class="keyword">if</span> (dialog<span class="operator">.</span>exec())
      fileNames <span class="operator">=</span> dialog<span class="operator">.</span>selectedFiles();

</pre>
<p>In the above example, a modal file dialog is created and shown. If the user clicked OK, the file they selected is put in <code>fileName</code>.</p>
<p>The dialog's working directory can be set with <a href="qfiledialog.html#setDirectory">setDirectory</a>(). Each file in the current directory can be selected using the <a href="qfiledialog.html#selectFile">selectFile</a>() function.</p>
<p>The <a href="qtwidgets-dialogs-standarddialogs-example.html">Standard Dialogs</a> example shows how to use <a href="qfiledialog.html">QFileDialog</a> as well as other built-in Qt dialogs.</p>
<p>By default, a platform-native file dialog will be used if the platform has one. In that case, the widgets which would otherwise be used to construct the dialog will not be instantiated, so related accessors such as <a href="qwidget.html#layout">layout</a>() and <a href="qfiledialog.html#itemDelegate">itemDelegate</a>() will return null. You can set the <a href="qfiledialog.html#Option-enum">DontUseNativeDialog</a> option to ensure that the widget-based implementation will be used instead of the native dialog.</p>
</div>
<p><b>See also </b><a href="../qtcore/qdir.html">QDir</a>, <a href="../qtcore/qfileinfo.html">QFileInfo</a>, <a href="../qtcore/qfile.html">QFile</a>, <a href="qcolordialog.html">QColorDialog</a>, <a href="qfontdialog.html">QFontDialog</a>, <a href="qtwidgets-dialogs-standarddialogs-example.html">Standard Dialogs Example</a>, and <a href="qtwidgets-mainwindows-application-example.html">Application Example</a>.</p>
<!-- @@@QFileDialog -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$AcceptMode$$$AcceptOpen$$$AcceptSave -->
<h3 class="fn" id="AcceptMode-enum"><a name="AcceptMode-enum"></a>enum QFileDialog::<span class="name">AcceptMode</span></h3>
<div class="table"><table class="valuelist"><tr><th class="tblConst">Constant</th><th class="tblVal">Value</th></tr>
<tr><td class="topAlign"><code>QFileDialog::AcceptOpen</code></td><td class="topAlign tblval"><code>0</code></td></tr>
<tr><td class="topAlign"><code>QFileDialog::AcceptSave</code></td><td class="topAlign tblval"><code>1</code></td></tr>
</table></div>
<!-- @@@AcceptMode -->
<!-- $$$DialogLabel$$$LookIn$$$FileName$$$FileType$$$Accept$$$Reject -->
<h3 class="fn" id="DialogLabel-enum"><a name="DialogLabel-enum"></a>enum QFileDialog::<span class="name">DialogLabel</span></h3>
<div class="table"><table class="valuelist"><tr><th class="tblConst">Constant</th><th class="tblVal">Value</th></tr>
<tr><td class="topAlign"><code>QFileDialog::LookIn</code></td><td class="topAlign tblval"><code>0</code></td></tr>
<tr><td class="topAlign"><code>QFileDialog::FileName</code></td><td class="topAlign tblval"><code>1</code></td></tr>
<tr><td class="topAlign"><code>QFileDialog::FileType</code></td><td class="topAlign tblval"><code>2</code></td></tr>
<tr><td class="topAlign"><code>QFileDialog::Accept</code></td><td class="topAlign tblval"><code>3</code></td></tr>
<tr><td class="topAlign"><code>QFileDialog::Reject</code></td><td class="topAlign tblval"><code>4</code></td></tr>
</table></div>
<!-- @@@DialogLabel -->
<!-- $$$FileMode$$$AnyFile$$$ExistingFile$$$Directory$$$ExistingFiles$$$DirectoryOnly -->
<h3 class="fn" id="FileMode-enum"><a name="FileMode-enum"></a>enum QFileDialog::<span class="name">FileMode</span></h3>
<p>This enum is used to indicate what the user may select in the file dialog; i.e&#x2e; what the dialog will return if the user clicks OK.</p>
<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>QFileDialog::AnyFile</code></td><td class="topAlign tblval"><code>0</code></td><td class="topAlign">The name of a file, whether it exists or not.</td></tr>
<tr><td class="topAlign"><code>QFileDialog::ExistingFile</code></td><td class="topAlign tblval"><code>1</code></td><td class="topAlign">The name of a single existing file.</td></tr>
<tr><td class="topAlign"><code>QFileDialog::Directory</code></td><td class="topAlign tblval"><code>2</code></td><td class="topAlign">The name of a directory. Both files and directories are displayed. However, the native Windows file dialog does not support displaying files in the directory chooser.</td></tr>
<tr><td class="topAlign"><code>QFileDialog::ExistingFiles</code></td><td class="topAlign tblval"><code>3</code></td><td class="topAlign">The names of zero or more existing files.</td></tr>
</table></div>
<p>This value is obsolete since Qt 4.5:</p>
<div class="table"><table class="valuelist"><tr valign="top" class="even"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>QFileDialog::DirectoryOnly</code></td><td class="topAlign tblval"><code>4</code></td><td class="topAlign">Use <code>Directory</code> and <a href="qfiledialog.html#setOption">setOption</a>(<a href="qfiledialog.html#Option-enum">ShowDirsOnly</a>, true) instead.</td></tr>
</table></div>
<p><b>See also </b><a href="qfiledialog.html#fileMode-prop">setFileMode</a>().</p>
<!-- @@@FileMode -->
<!-- $$$Option$$$ShowDirsOnly$$$DontResolveSymlinks$$$DontConfirmOverwrite$$$DontUseSheet$$$DontUseNativeDialog$$$ReadOnly$$$HideNameFilterDetails$$$DontUseCustomDirectoryIcons -->
<h3 class="flags" id="Option-enum"><a name="Option-enum"></a>enum QFileDialog::<span class="name">Option</span><br/>flags QFileDialog::<span class="name">Options</span></h3>
<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>QFileDialog::ShowDirsOnly</code></td><td class="topAlign tblval"><code>0x00000001</code></td><td class="topAlign">Only show directories in the file dialog. By default both files and directories are shown. (Valid only in the <a href="qfiledialog.html#FileMode-enum">Directory</a> file mode.)</td></tr>
<tr><td class="topAlign"><code>QFileDialog::DontResolveSymlinks</code></td><td class="topAlign tblval"><code>0x00000002</code></td><td class="topAlign">Don't resolve symlinks in the file dialog. By default symlinks are resolved.</td></tr>
<tr><td class="topAlign"><code>QFileDialog::DontConfirmOverwrite</code></td><td class="topAlign tblval"><code>0x00000004</code></td><td class="topAlign">Don't ask for confirmation if an existing file is selected. By default confirmation is requested.</td></tr>
<tr><td class="topAlign"><code>QFileDialog::DontUseNativeDialog</code></td><td class="topAlign tblval"><code>0x00000010</code></td><td class="topAlign">Don't use the native file dialog. By default, the native file dialog is used unless you use a subclass of <a href="qfiledialog.html">QFileDialog</a> that contains the <a href="../qtcore/qobject.html#Q_OBJECT">Q_OBJECT</a> macro, or the platform does not have a native dialog of the type that you require.</td></tr>
<tr><td class="topAlign"><code>QFileDialog::ReadOnly</code></td><td class="topAlign tblval"><code>0x00000020</code></td><td class="topAlign">Indicates that the model is readonly.</td></tr>
<tr><td class="topAlign"><code>QFileDialog::HideNameFilterDetails</code></td><td class="topAlign tblval"><code>0x00000040</code></td><td class="topAlign">Indicates if the file name filter details are hidden or not.</td></tr>
<tr><td class="topAlign"><code>QFileDialog::DontUseSheet</code></td><td class="topAlign tblval"><code>0x00000008</code></td><td class="topAlign">In previous versions of Qt, the static functions would create a sheet by default if the static function was given a parent. This is no longer supported and does nothing in Qt 4.5, The static functions will always be an application modal dialog. If you want to use sheets, use <a href="qfiledialog.html#open">QFileDialog::open</a>() instead.</td></tr>
<tr><td class="topAlign"><code>QFileDialog::DontUseCustomDirectoryIcons</code></td><td class="topAlign tblval"><code>0x00000080</code></td><td class="topAlign">Always use the default directory icon. Some platforms allow the user to set a different icon. Custom icon lookup cause a big performance impact over network or removable drives. Setting this will enable the <a href="qfileiconprovider.html#Option-enum">QFileIconProvider::DontUseCustomDirectoryIcons</a> option in the icon provider. This enum value was added in Qt 5.2&#x2e;</td></tr>
</table></div>
<p>The Options type is a typedef for <a href="../qtcore/qflags.html">QFlags</a>&lt;Option&gt;. It stores an OR combination of Option values.</p>
<!-- @@@Option -->
<!-- $$$ViewMode$$$Detail$$$List -->
<h3 class="fn" id="ViewMode-enum"><a name="ViewMode-enum"></a>enum QFileDialog::<span class="name">ViewMode</span></h3>
<p>This enum describes the view mode of the file dialog; i.e&#x2e; what information about each file will be displayed.</p>
<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>QFileDialog::Detail</code></td><td class="topAlign tblval"><code>0</code></td><td class="topAlign">Displays an icon, a name, and details for each item in the directory.</td></tr>
<tr><td class="topAlign"><code>QFileDialog::List</code></td><td class="topAlign tblval"><code>1</code></td><td class="topAlign">Displays only an icon and a name for each item in the directory.</td></tr>
</table></div>
<p><b>See also </b><a href="qfiledialog.html#viewMode-prop">setViewMode</a>().</p>
<!-- @@@ViewMode -->
</div>
<div class="prop">
<h2>Property Documentation</h2>
<!-- $$$acceptMode-prop$$$acceptMode$$$setAcceptModeAcceptMode -->
<h3 class="fn" id="acceptMode-prop"><a name="acceptMode-prop"></a><span class="name">acceptMode</span> : <span class="type"><a href="qfiledialog.html#AcceptMode-enum">AcceptMode</a></span></h3>
<p>This property holds the accept mode of the dialog</p>
<p>The action mode defines whether the dialog is for opening or saving files.</p>
<p>By default, this property is set to <a href="qfiledialog.html#AcceptMode-enum">AcceptOpen</a>.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> AcceptMode </td><td class="memItemRight bottomAlign"><span class="name"><b>acceptMode</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setAcceptMode</b></span>(AcceptMode <i>mode</i>)</td></tr>
</table></div>
<p><b>See also </b><a href="qfiledialog.html#AcceptMode-enum">AcceptMode</a>.</p>
<!-- @@@acceptMode -->
<!-- $$$defaultSuffix-prop$$$defaultSuffix$$$setDefaultSuffixconstQString& -->
<h3 class="fn" id="defaultSuffix-prop"><a name="defaultSuffix-prop"></a><span class="name">defaultSuffix</span> : <span class="type"><a href="../qtcore/qstring.html">QString</a></span></h3>
<p>suffix added to the filename if no other suffix was specified</p>
<p>This property specifies a string that will be added to the filename if it has no suffix already. The suffix is typically used to indicate the file type (e.g&#x2e; &quot;txt&quot; indicates a text file).</p>
<p>If the first character is a dot ('.'), it is removed.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QString </td><td class="memItemRight bottomAlign"><span class="name"><b>defaultSuffix</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setDefaultSuffix</b></span>(const QString &amp;<i>suffix</i>)</td></tr>
</table></div>
<!-- @@@defaultSuffix -->
<!-- $$$fileMode-prop$$$fileMode$$$setFileModeFileMode -->
<h3 class="fn" id="fileMode-prop"><a name="fileMode-prop"></a><span class="name">fileMode</span> : <span class="type"><a href="qfiledialog.html#FileMode-enum">FileMode</a></span></h3>
<p>This property holds the file mode of the dialog</p>
<p>The file mode defines the number and type of items that the user is expected to select in the dialog.</p>
<p>By default, this property is set to <a href="qfiledialog.html#FileMode-enum">AnyFile</a>.</p>
<p>This function will set the labels for the <a href="qfiledialog.html#DialogLabel-enum">FileName</a> and <a href="qfiledialog.html#DialogLabel-enum">Accept</a> <a href="qfiledialog.html#DialogLabel-enum">DialogLabel</a>s. It is possible to set custom text after the call to setFileMode().</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> FileMode </td><td class="memItemRight bottomAlign"><span class="name"><b>fileMode</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setFileMode</b></span>(FileMode <i>mode</i>)</td></tr>
</table></div>
<p><b>See also </b><a href="qfiledialog.html#FileMode-enum">FileMode</a>.</p>
<!-- @@@fileMode -->
<!-- $$$options-prop$$$options$$$setOptionsOptions -->
<h3 class="fn" id="options-prop"><a name="options-prop"></a><span class="name">options</span> : <span class="type"><a href="qfiledialog.html#Option-enum">Options</a></span></h3>
<p>This property holds the various options that affect the look and feel of the dialog</p>
<p>By default, all options are disabled.</p>
<p>Options should be set before showing the dialog. Setting them while the dialog is visible is not guaranteed to have an immediate effect on the dialog (depending on the option and on the platform).</p>
<p>This property was introduced in  Qt 4.5.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> Options </td><td class="memItemRight bottomAlign"><span class="name"><b>options</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setOptions</b></span>(Options <i>options</i>)</td></tr>
</table></div>
<p><b>See also </b><a href="qfiledialog.html#setOption">setOption</a>() and <a href="qfiledialog.html#testOption">testOption</a>().</p>
<!-- @@@options -->
<!-- $$$supportedSchemes-prop$$$supportedSchemes$$$setSupportedSchemesconstQStringList& -->
<h3 class="fn" id="supportedSchemes-prop"><a name="supportedSchemes-prop"></a><span class="name">supportedSchemes</span> : <span class="type"><a href="../qtcore/qstringlist.html">QStringList</a></span></h3>
<p>This property holds the URL schemes that the file dialog should allow navigating to.</p>
<p>Setting this property allows to restrict the type of URLs the user will be able to select. It is a way for the application to declare the protocols it will support to fetch the file content. An empty list means that no restriction is applied (the default). Supported for local files (&quot;file&quot; scheme) is implicit and always enabled; it is not necessary to include it in the restriction.</p>
<p>This property was introduced in  Qt 5.6.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QStringList </td><td class="memItemRight bottomAlign"><span class="name"><b>supportedSchemes</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setSupportedSchemes</b></span>(const QStringList &amp;<i>schemes</i>)</td></tr>
</table></div>
<!-- @@@supportedSchemes -->
<!-- $$$viewMode-prop$$$viewMode$$$setViewModeViewMode -->
<h3 class="fn" id="viewMode-prop"><a name="viewMode-prop"></a><span class="name">viewMode</span> : <span class="type"><a href="qfiledialog.html#ViewMode-enum">ViewMode</a></span></h3>
<p>This property holds the way files and directories are displayed in the dialog</p>
<p>By default, the <code>Detail</code> mode is used to display information about files and directories.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> ViewMode </td><td class="memItemRight bottomAlign"><span class="name"><b>viewMode</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setViewMode</b></span>(ViewMode <i>mode</i>)</td></tr>
</table></div>
<p><b>See also </b><a href="qfiledialog.html#ViewMode-enum">ViewMode</a>.</p>
<!-- @@@viewMode -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QFileDialog[overload1]$$$QFileDialogQWidget*Qt::WindowFlags -->
<h3 class="fn" id="QFileDialog"><a name="QFileDialog"></a>QFileDialog::<span class="name">QFileDialog</span>(<span class="type"><a href="qwidget.html#QWidget">QWidget</a></span> *<i>parent</i>, <span class="type"><a href="../qtcore/qt.html#WindowType-enum">Qt::WindowFlags</a></span> <i>flags</i>)</h3>
<p>Constructs a file dialog with the given <i>parent</i> and widget <i>flags</i>.</p>
<!-- @@@QFileDialog -->
<!-- $$$QFileDialog$$$QFileDialogQWidget*constQString&constQString&constQString& -->
<h3 class="fn" id="QFileDialog-1"><a name="QFileDialog-1"></a>QFileDialog::<span class="name">QFileDialog</span>(<span class="type"><a href="qwidget.html#QWidget">QWidget</a></span> *<i>parent</i> = Q_NULLPTR, const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>caption</i> = QString(), const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>directory</i> = QString(), const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>filter</i> = QString())</h3>
<p>Constructs a file dialog with the given <i>parent</i> and <i>caption</i> that initially displays the contents of the specified <i>directory</i>. The contents of the directory are filtered before being shown in the dialog, using a semicolon-separated list of filters specified by <i>filter</i>.</p>
<!-- @@@QFileDialog -->
<!-- $$$~QFileDialog[overload1]$$$~QFileDialog -->
<h3 class="fn" id="dtor.QFileDialog"><a name="dtor.QFileDialog"></a>QFileDialog::<span class="name">~QFileDialog</span>()</h3>
<p>Destroys the file dialog.</p>
<!-- @@@~QFileDialog -->
<!-- $$$accept[overload1]$$$accept -->
<h3 class="fn" id="accept"><a name="accept"></a><code>[virtual protected] </code><span class="type">void</span> QFileDialog::<span class="name">accept</span>()</h3>
<p>Reimplemented from <a href="qdialog.html#accept">QDialog::accept</a>().</p>
<!-- @@@accept -->
<!-- $$$changeEvent[overload1]$$$changeEventQEvent* -->
<h3 class="fn" id="changeEvent"><a name="changeEvent"></a><code>[virtual protected] </code><span class="type">void</span> QFileDialog::<span class="name">changeEvent</span>(<span class="type"><a href="../qtcore/qevent.html">QEvent</a></span> *<i>e</i>)</h3>
<p>Reimplemented from <a href="qwidget.html#changeEvent">QWidget::changeEvent</a>().</p>
<!-- @@@changeEvent -->
<!-- $$$currentChanged[overload1]$$$currentChangedconstQString& -->
<h3 class="fn" id="currentChanged"><a name="currentChanged"></a><code>[signal] </code><span class="type">void</span> QFileDialog::<span class="name">currentChanged</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>path</i>)</h3>
<p>When the current file changes for local operations, this signal is emitted with the new file name as the <i>path</i> parameter.</p>
<p><b>See also </b><a href="qfiledialog.html#filesSelected">filesSelected</a>().</p>
<!-- @@@currentChanged -->
<!-- $$$currentUrlChanged[overload1]$$$currentUrlChangedconstQUrl& -->
<h3 class="fn" id="currentUrlChanged"><a name="currentUrlChanged"></a><code>[signal] </code><span class="type">void</span> QFileDialog::<span class="name">currentUrlChanged</span>(const <span class="type"><a href="../qtcore/qurl.html">QUrl</a></span> &amp;<i>url</i>)</h3>
<p>When the current file changes, this signal is emitted with the new file URL as the <i>url</i> parameter.</p>
<p>This function was introduced in  Qt 5.2.</p>
<p><b>See also </b><a href="qfiledialog.html#urlsSelected">urlsSelected</a>().</p>
<!-- @@@currentUrlChanged -->
<!-- $$$directory[overload1]$$$directory -->
<h3 class="fn" id="directory"><a name="directory"></a><span class="type"><a href="../qtcore/qdir.html">QDir</a></span> QFileDialog::<span class="name">directory</span>() const</h3>
<p>Returns the directory currently being displayed in the dialog.</p>
<p><b>See also </b><a href="qfiledialog.html#setDirectory">setDirectory</a>().</p>
<!-- @@@directory -->
<!-- $$$directoryEntered[overload1]$$$directoryEnteredconstQString& -->
<h3 class="fn" id="directoryEntered"><a name="directoryEntered"></a><code>[signal] </code><span class="type">void</span> QFileDialog::<span class="name">directoryEntered</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>directory</i>)</h3>
<p>This signal is emitted for local operations when the user enters a <i>directory</i>.</p>
<p>This function was introduced in  Qt 4.3.</p>
<!-- @@@directoryEntered -->
<!-- $$$directoryUrl[overload1]$$$directoryUrl -->
<h3 class="fn" id="directoryUrl"><a name="directoryUrl"></a><span class="type"><a href="../qtcore/qurl.html">QUrl</a></span> QFileDialog::<span class="name">directoryUrl</span>() const</h3>
<p>Returns the url of the directory currently being displayed in the dialog.</p>
<p>This function was introduced in  Qt 5.2.</p>
<p><b>See also </b><a href="qfiledialog.html#setDirectoryUrl">setDirectoryUrl</a>().</p>
<!-- @@@directoryUrl -->
<!-- $$$directoryUrlEntered[overload1]$$$directoryUrlEnteredconstQUrl& -->
<h3 class="fn" id="directoryUrlEntered"><a name="directoryUrlEntered"></a><code>[signal] </code><span class="type">void</span> QFileDialog::<span class="name">directoryUrlEntered</span>(const <span class="type"><a href="../qtcore/qurl.html">QUrl</a></span> &amp;<i>directory</i>)</h3>
<p>This signal is emitted when the user enters a <i>directory</i>.</p>
<p>This function was introduced in  Qt 5.2.</p>
<!-- @@@directoryUrlEntered -->
<!-- $$$done[overload1]$$$doneint -->
<h3 class="fn" id="done"><a name="done"></a><code>[virtual protected] </code><span class="type">void</span> QFileDialog::<span class="name">done</span>(<span class="type">int</span> <i>result</i>)</h3>
<p>Reimplemented from <a href="qdialog.html#done">QDialog::done</a>().</p>
<!-- @@@done -->
<!-- $$$fileSelected[overload1]$$$fileSelectedconstQString& -->
<h3 class="fn" id="fileSelected"><a name="fileSelected"></a><code>[signal] </code><span class="type">void</span> QFileDialog::<span class="name">fileSelected</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>file</i>)</h3>
<p>When the selection changes for local operations and the dialog is accepted, this signal is emitted with the (possibly empty) selected <i>file</i>.</p>
<p><b>See also </b><a href="qfiledialog.html#currentChanged">currentChanged</a>() and <a href="qdialog.html#DialogCode-enum">QDialog::Accepted</a>.</p>
<!-- @@@fileSelected -->
<!-- $$$filesSelected[overload1]$$$filesSelectedconstQStringList& -->
<h3 class="fn" id="filesSelected"><a name="filesSelected"></a><code>[signal] </code><span class="type">void</span> QFileDialog::<span class="name">filesSelected</span>(const <span class="type"><a href="../qtcore/qstringlist.html">QStringList</a></span> &amp;<i>selected</i>)</h3>
<p>When the selection changes for local operations and the dialog is accepted, this signal is emitted with the (possibly empty) list of <i>selected</i> files.</p>
<p><b>See also </b><a href="qfiledialog.html#currentChanged">currentChanged</a>() and <a href="qdialog.html#DialogCode-enum">QDialog::Accepted</a>.</p>
<!-- @@@filesSelected -->
<!-- $$$filter[overload1]$$$filter -->
<h3 class="fn" id="filter"><a name="filter"></a><span class="type"><a href="../qtcore/qdir.html#Filter-enum">QDir::Filters</a></span> QFileDialog::<span class="name">filter</span>() const</h3>
<p>Returns the filter that is used when displaying files.</p>
<p>This function was introduced in  Qt 4.4.</p>
<p><b>See also </b><a href="qfiledialog.html#setFilter">setFilter</a>().</p>
<!-- @@@filter -->
<!-- $$$filterSelected[overload1]$$$filterSelectedconstQString& -->
<h3 class="fn" id="filterSelected"><a name="filterSelected"></a><code>[signal] </code><span class="type">void</span> QFileDialog::<span class="name">filterSelected</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>filter</i>)</h3>
<p>This signal is emitted when the user selects a <i>filter</i>.</p>
<p>This function was introduced in  Qt 4.3.</p>
<!-- @@@filterSelected -->
<!-- $$$getExistingDirectory[overload1]$$$getExistingDirectoryQWidget*constQString&constQString&Options -->
<h3 class="fn" id="getExistingDirectory"><a name="getExistingDirectory"></a><code>[static] </code><span class="type"><a href="../qtcore/qstring.html">QString</a></span> QFileDialog::<span class="name">getExistingDirectory</span>(<span class="type"><a href="qwidget.html#QWidget">QWidget</a></span> *<i>parent</i> = Q_NULLPTR, const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>caption</i> = QString(), const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>dir</i> = QString(), <span class="type"><a href="qfiledialog.html#Option-enum">Options</a></span> <i>options</i> = ShowDirsOnly)</h3>
<p>This is a convenience static function that will return an existing directory selected by the user.</p>
<pre class="cpp">

  <span class="type"><a href="../qtcore/qstring.html">QString</a></span> dir <span class="operator">=</span> <span class="type"><a href="qfiledialog.html#QFileDialog">QFileDialog</a></span><span class="operator">::</span>getExistingDirectory(<span class="keyword">this</span><span class="operator">,</span> tr(<span class="string">&quot;Open Directory&quot;</span>)<span class="operator">,</span>
                                                  <span class="string">&quot;/home&quot;</span><span class="operator">,</span>
                                                  <span class="type"><a href="qfiledialog.html#QFileDialog">QFileDialog</a></span><span class="operator">::</span>ShowDirsOnly
                                                  <span class="operator">|</span> <span class="type"><a href="qfiledialog.html#QFileDialog">QFileDialog</a></span><span class="operator">::</span>DontResolveSymlinks);

</pre>
<p>This function creates a modal file dialog with the given <i>parent</i> widget. If <i>parent</i> is not 0, the dialog will be shown centered over the parent widget.</p>
<p>The dialog's working directory is set to <i>dir</i>, and the caption is set to <i>caption</i>. Either of these may be an empty string in which case the current directory and a default caption will be used respectively.</p>
<p>The <i>options</i> argument holds various options about how to run the dialog, see the <a href="qfiledialog.html#Option-enum">QFileDialog::Option</a> enum for more information on the flags you can pass. To ensure a native file dialog, <a href="qfiledialog.html#Option-enum">ShowDirsOnly</a> must be set.</p>
<p>On Windows and macOS, this static function will use the native file dialog and not a <a href="qfiledialog.html">QFileDialog</a>. However, the native Windows file dialog does not support displaying files in the directory chooser. You need to pass <a href="qfiledialog.html#Option-enum">DontUseNativeDialog</a> to display files using a <a href="qfiledialog.html">QFileDialog</a>.</p>
<p>On Unix/X11, the normal behavior of the file dialog is to resolve and follow symlinks. For example, if <code>/usr/tmp</code> is a symlink to <code>/var/tmp</code>, the file dialog will change to <code>/var/tmp</code> after entering <code>/usr/tmp</code>. If <i>options</i> includes <a href="qfiledialog.html#Option-enum">DontResolveSymlinks</a>, the file dialog will treat symlinks as regular directories.</p>
<p>On Windows, the dialog will spin a blocking modal event loop that will not dispatch any QTimers, and if <i>parent</i> is not 0 then it will position the dialog just below the parent's title bar.</p>
<p><b>Warning:</b> Do not delete <i>parent</i> during the execution of the dialog. If you want to do this, you should create the dialog yourself using one of the <a href="qfiledialog.html">QFileDialog</a> constructors.</p>
<p><b>See also </b><a href="qfiledialog.html#getOpenFileName">getOpenFileName</a>(), <a href="qfiledialog.html#getOpenFileNames">getOpenFileNames</a>(), and <a href="qfiledialog.html#getSaveFileName">getSaveFileName</a>().</p>
<!-- @@@getExistingDirectory -->
<!-- $$$getExistingDirectoryUrl[overload1]$$$getExistingDirectoryUrlQWidget*constQString&constQUrl&OptionsconstQStringList& -->
<h3 class="fn" id="getExistingDirectoryUrl"><a name="getExistingDirectoryUrl"></a><code>[static] </code><span class="type"><a href="../qtcore/qurl.html">QUrl</a></span> QFileDialog::<span class="name">getExistingDirectoryUrl</span>(<span class="type"><a href="qwidget.html#QWidget">QWidget</a></span> *<i>parent</i> = Q_NULLPTR, const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>caption</i> = QString(), const <span class="type"><a href="../qtcore/qurl.html">QUrl</a></span> &amp;<i>dir</i> = QUrl(), <span class="type"><a href="qfiledialog.html#Option-enum">Options</a></span> <i>options</i> = ShowDirsOnly, const <span class="type"><a href="../qtcore/qstringlist.html">QStringList</a></span> &amp;<i>supportedSchemes</i> = QStringList())</h3>
<p>This is a convenience static function that will return an existing directory selected by the user. If the user presses Cancel, it returns an empty url.</p>
<p>The function is used similarly to <a href="qfiledialog.html#getExistingDirectory">QFileDialog::getExistingDirectory</a>(). In particular <i>parent</i>, <i>caption</i>, <i>dir</i> and <i>options</i> are used in the exact same way.</p>
<p>The main difference with <a href="qfiledialog.html#getExistingDirectory">QFileDialog::getExistingDirectory</a>() comes from the ability offered to the user to select a remote directory. That's why the return type and the type of <i>dir</i> is <a href="../qtcore/qurl.html">QUrl</a>.</p>
<p>The <i>supportedSchemes</i> argument allows to restrict the type of URLs the user will be able to select. It is a way for the application to declare the protocols it will support to fetch the file content. An empty list means that no restriction is applied (the default). Supported for local files (&quot;file&quot; scheme) is implicit and always enabled; it is not necessary to include it in the restriction.</p>
<p>When possible, this static function will use the native file dialog and not a <a href="qfiledialog.html">QFileDialog</a>. On platforms which don't support selecting remote files, Qt will allow to select only local files.</p>
<p>This function was introduced in  Qt 5.2.</p>
<p><b>See also </b><a href="qfiledialog.html#getExistingDirectory">getExistingDirectory</a>(), <a href="qfiledialog.html#getOpenFileUrl">getOpenFileUrl</a>(), <a href="qfiledialog.html#getOpenFileUrls">getOpenFileUrls</a>(), and <a href="qfiledialog.html#getSaveFileUrl">getSaveFileUrl</a>().</p>
<!-- @@@getExistingDirectoryUrl -->
<!-- $$$getOpenFileName[overload1]$$$getOpenFileNameQWidget*constQString&constQString&constQString&QString*Options -->
<h3 class="fn" id="getOpenFileName"><a name="getOpenFileName"></a><code>[static] </code><span class="type"><a href="../qtcore/qstring.html">QString</a></span> QFileDialog::<span class="name">getOpenFileName</span>(<span class="type"><a href="qwidget.html#QWidget">QWidget</a></span> *<i>parent</i> = Q_NULLPTR, const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>caption</i> = QString(), const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>dir</i> = QString(), const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>filter</i> = QString(), <span class="type"><a href="../qtcore/qstring.html">QString</a></span> *<i>selectedFilter</i> = Q_NULLPTR, <span class="type"><a href="qfiledialog.html#Option-enum">Options</a></span> <i>options</i> = Options())</h3>
<p>This is a convenience static function that returns an existing file selected by the user. If the user presses Cancel, it returns a null string.</p>
<pre class="cpp">

  <span class="type"><a href="../qtcore/qstring.html">QString</a></span> fileName <span class="operator">=</span> <span class="type"><a href="qfiledialog.html#QFileDialog">QFileDialog</a></span><span class="operator">::</span>getOpenFileName(<span class="keyword">this</span><span class="operator">,</span> tr(<span class="string">&quot;Open File&quot;</span>)<span class="operator">,</span>
                                                  <span class="string">&quot;/home&quot;</span><span class="operator">,</span>
                                                  tr(<span class="string">&quot;Images (*.png *.xpm *.jpg)&quot;</span>));

</pre>
<p>The function creates a modal file dialog with the given <i>parent</i> widget. If <i>parent</i> is not 0, the dialog will be shown centered over the parent widget.</p>
<p>The file dialog's working directory will be set to <i>dir</i>. If <i>dir</i> includes a file name, the file will be selected. Only files that match the given <i>filter</i> are shown. The filter selected is set to <i>selectedFilter</i>. The parameters <i>dir</i>, <i>selectedFilter</i>, and <i>filter</i> may be empty strings. If you want multiple filters, separate them with ';;', for example:</p>
<pre class="cpp">

  <span class="string">&quot;Images (*.png *.xpm *.jpg);;Text files (*.txt);;XML files (*.xml)&quot;</span>

</pre>
<p>The <i>options</i> argument holds various options about how to run the dialog, see the <a href="qfiledialog.html#Option-enum">QFileDialog::Option</a> enum for more information on the flags you can pass.</p>
<p>The dialog's caption is set to <i>caption</i>. If <i>caption</i> is not specified then a default caption will be used.</p>
<p>On Windows, and macOS, this static function will use the native file dialog and not a <a href="qfiledialog.html">QFileDialog</a>.</p>
<p>On Windows the dialog will spin a blocking modal event loop that will not dispatch any QTimers, and if <i>parent</i> is not 0 then it will position the dialog just below the parent's title bar.</p>
<p>On Unix/X11, the normal behavior of the file dialog is to resolve and follow symlinks. For example, if <code>/usr/tmp</code> is a symlink to <code>/var/tmp</code>, the file dialog will change to <code>/var/tmp</code> after entering <code>/usr/tmp</code>. If <i>options</i> includes <a href="qfiledialog.html#Option-enum">DontResolveSymlinks</a>, the file dialog will treat symlinks as regular directories.</p>
<p><b>Warning:</b> Do not delete <i>parent</i> during the execution of the dialog. If you want to do this, you should create the dialog yourself using one of the <a href="qfiledialog.html">QFileDialog</a> constructors.</p>
<p><b>See also </b><a href="qfiledialog.html#getOpenFileNames">getOpenFileNames</a>(), <a href="qfiledialog.html#getSaveFileName">getSaveFileName</a>(), and <a href="qfiledialog.html#getExistingDirectory">getExistingDirectory</a>().</p>
<!-- @@@getOpenFileName -->
<!-- $$$getOpenFileNames[overload1]$$$getOpenFileNamesQWidget*constQString&constQString&constQString&QString*Options -->
<h3 class="fn" id="getOpenFileNames"><a name="getOpenFileNames"></a><code>[static] </code><span class="type"><a href="../qtcore/qstringlist.html">QStringList</a></span> QFileDialog::<span class="name">getOpenFileNames</span>(<span class="type"><a href="qwidget.html#QWidget">QWidget</a></span> *<i>parent</i> = Q_NULLPTR, const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>caption</i> = QString(), const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>dir</i> = QString(), const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>filter</i> = QString(), <span class="type"><a href="../qtcore/qstring.html">QString</a></span> *<i>selectedFilter</i> = Q_NULLPTR, <span class="type"><a href="qfiledialog.html#Option-enum">Options</a></span> <i>options</i> = Options())</h3>
<p>This is a convenience static function that will return one or more existing files selected by the user.</p>
<pre class="cpp">

  <span class="type"><a href="../qtcore/qstringlist.html">QStringList</a></span> files <span class="operator">=</span> <span class="type"><a href="qfiledialog.html#QFileDialog">QFileDialog</a></span><span class="operator">::</span>getOpenFileNames(
                          <span class="keyword">this</span><span class="operator">,</span>
                          <span class="string">&quot;Select one or more files to open&quot;</span><span class="operator">,</span>
                          <span class="string">&quot;/home&quot;</span><span class="operator">,</span>
                          <span class="string">&quot;Images (*.png *.xpm *.jpg)&quot;</span>);

</pre>
<p>This function creates a modal file dialog with the given <i>parent</i> widget. If <i>parent</i> is not 0, the dialog will be shown centered over the parent widget.</p>
<p>The file dialog's working directory will be set to <i>dir</i>. If <i>dir</i> includes a file name, the file will be selected. The filter is set to <i>filter</i> so that only those files which match the filter are shown. The filter selected is set to <i>selectedFilter</i>. The parameters <i>dir</i>, <i>selectedFilter</i> and <i>filter</i> may be empty strings. If you need multiple filters, separate them with ';;', for instance:</p>
<pre class="cpp">

  <span class="string">&quot;Images (*.png *.xpm *.jpg);;Text files (*.txt);;XML files (*.xml)&quot;</span>

</pre>
<p>The dialog's caption is set to <i>caption</i>. If <i>caption</i> is not specified then a default caption will be used.</p>
<p>On Windows, and macOS, this static function will use the native file dialog and not a <a href="qfiledialog.html">QFileDialog</a>.</p>
<p>On Windows the dialog will spin a blocking modal event loop that will not dispatch any QTimers, and if <i>parent</i> is not 0 then it will position the dialog just below the parent's title bar.</p>
<p>On Unix/X11, the normal behavior of the file dialog is to resolve and follow symlinks. For example, if <code>/usr/tmp</code> is a symlink to <code>/var/tmp</code>, the file dialog will change to <code>/var/tmp</code> after entering <code>/usr/tmp</code>. The <i>options</i> argument holds various options about how to run the dialog, see the <a href="qfiledialog.html#Option-enum">QFileDialog::Option</a> enum for more information on the flags you can pass.</p>
<p><b>Warning:</b> Do not delete <i>parent</i> during the execution of the dialog. If you want to do this, you should create the dialog yourself using one of the <a href="qfiledialog.html">QFileDialog</a> constructors.</p>
<p><b>See also </b><a href="qfiledialog.html#getOpenFileName">getOpenFileName</a>(), <a href="qfiledialog.html#getSaveFileName">getSaveFileName</a>(), and <a href="qfiledialog.html#getExistingDirectory">getExistingDirectory</a>().</p>
<!-- @@@getOpenFileNames -->
<!-- $$$getOpenFileUrl[overload1]$$$getOpenFileUrlQWidget*constQString&constQUrl&constQString&QString*OptionsconstQStringList& -->
<h3 class="fn" id="getOpenFileUrl"><a name="getOpenFileUrl"></a><code>[static] </code><span class="type"><a href="../qtcore/qurl.html">QUrl</a></span> QFileDialog::<span class="name">getOpenFileUrl</span>(<span class="type"><a href="qwidget.html#QWidget">QWidget</a></span> *<i>parent</i> = Q_NULLPTR, const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>caption</i> = QString(), const <span class="type"><a href="../qtcore/qurl.html">QUrl</a></span> &amp;<i>dir</i> = QUrl(), const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>filter</i> = QString(), <span class="type"><a href="../qtcore/qstring.html">QString</a></span> *<i>selectedFilter</i> = Q_NULLPTR, <span class="type"><a href="qfiledialog.html#Option-enum">Options</a></span> <i>options</i> = Options(), const <span class="type"><a href="../qtcore/qstringlist.html">QStringList</a></span> &amp;<i>supportedSchemes</i> = QStringList())</h3>
<p>This is a convenience static function that returns an existing file selected by the user. If the user presses Cancel, it returns an empty url.</p>
<p>The function is used similarly to <a href="qfiledialog.html#getOpenFileName">QFileDialog::getOpenFileName</a>(). In particular <i>parent</i>, <i>caption</i>, <i>dir</i>, <i>filter</i>, <i>selectedFilter</i> and <i>options</i> are used in the exact same way.</p>
<p>The main difference with <a href="qfiledialog.html#getOpenFileName">QFileDialog::getOpenFileName</a>() comes from the ability offered to the user to select a remote file. That's why the return type and the type of <i>dir</i> is <a href="../qtcore/qurl.html">QUrl</a>.</p>
<p>The <i>supportedSchemes</i> argument allows to restrict the type of URLs the user will be able to select. It is a way for the application to declare the protocols it will support to fetch the file content. An empty list means that no restriction is applied (the default). Supported for local files (&quot;file&quot; scheme) is implicit and always enabled; it is not necessary to include it in the restriction.</p>
<p>When possible, this static function will use the native file dialog and not a <a href="qfiledialog.html">QFileDialog</a>. On platforms which don't support selecting remote files, Qt will allow to select only local files.</p>
<p>This function was introduced in  Qt 5.2.</p>
<p><b>See also </b><a href="qfiledialog.html#getOpenFileName">getOpenFileName</a>(), <a href="qfiledialog.html#getOpenFileUrls">getOpenFileUrls</a>(), <a href="qfiledialog.html#getSaveFileUrl">getSaveFileUrl</a>(), and <a href="qfiledialog.html#getExistingDirectoryUrl">getExistingDirectoryUrl</a>().</p>
<!-- @@@getOpenFileUrl -->
<!-- $$$getOpenFileUrls[overload1]$$$getOpenFileUrlsQWidget*constQString&constQUrl&constQString&QString*OptionsconstQStringList& -->
<h3 class="fn" id="getOpenFileUrls"><a name="getOpenFileUrls"></a><code>[static] </code><span class="type"><a href="../qtcore/qlist.html">QList</a></span>&lt;<span class="type"><a href="../qtcore/qurl.html">QUrl</a></span>&gt; QFileDialog::<span class="name">getOpenFileUrls</span>(<span class="type"><a href="qwidget.html#QWidget">QWidget</a></span> *<i>parent</i> = Q_NULLPTR, const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>caption</i> = QString(), const <span class="type"><a href="../qtcore/qurl.html">QUrl</a></span> &amp;<i>dir</i> = QUrl(), const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>filter</i> = QString(), <span class="type"><a href="../qtcore/qstring.html">QString</a></span> *<i>selectedFilter</i> = Q_NULLPTR, <span class="type"><a href="qfiledialog.html#Option-enum">Options</a></span> <i>options</i> = Options(), const <span class="type"><a href="../qtcore/qstringlist.html">QStringList</a></span> &amp;<i>supportedSchemes</i> = QStringList())</h3>
<p>This is a convenience static function that will return one or more existing files selected by the user. If the user presses Cancel, it returns an empty list.</p>
<p>The function is used similarly to <a href="qfiledialog.html#getOpenFileNames">QFileDialog::getOpenFileNames</a>(). In particular <i>parent</i>, <i>caption</i>, <i>dir</i>, <i>filter</i>, <i>selectedFilter</i> and <i>options</i> are used in the exact same way.</p>
<p>The main difference with <a href="qfiledialog.html#getOpenFileNames">QFileDialog::getOpenFileNames</a>() comes from the ability offered to the user to select remote files. That's why the return type and the type of <i>dir</i> are respectively <a href="../qtcore/qlist.html">QList</a>&lt;<a href="../qtcore/qurl.html">QUrl</a>&gt; and <a href="../qtcore/qurl.html">QUrl</a>.</p>
<p>The <i>supportedSchemes</i> argument allows to restrict the type of URLs the user will be able to select. It is a way for the application to declare the protocols it will support to fetch the file content. An empty list means that no restriction is applied (the default). Supported for local files (&quot;file&quot; scheme) is implicit and always enabled; it is not necessary to include it in the restriction.</p>
<p>When possible, this static function will use the native file dialog and not a <a href="qfiledialog.html">QFileDialog</a>. On platforms which don't support selecting remote files, Qt will allow to select only local files.</p>
<p>This function was introduced in  Qt 5.2.</p>
<p><b>See also </b><a href="qfiledialog.html#getOpenFileNames">getOpenFileNames</a>(), <a href="qfiledialog.html#getOpenFileUrl">getOpenFileUrl</a>(), <a href="qfiledialog.html#getSaveFileUrl">getSaveFileUrl</a>(), and <a href="qfiledialog.html#getExistingDirectoryUrl">getExistingDirectoryUrl</a>().</p>
<!-- @@@getOpenFileUrls -->
<!-- $$$getSaveFileName[overload1]$$$getSaveFileNameQWidget*constQString&constQString&constQString&QString*Options -->
<h3 class="fn" id="getSaveFileName"><a name="getSaveFileName"></a><code>[static] </code><span class="type"><a href="../qtcore/qstring.html">QString</a></span> QFileDialog::<span class="name">getSaveFileName</span>(<span class="type"><a href="qwidget.html#QWidget">QWidget</a></span> *<i>parent</i> = Q_NULLPTR, const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>caption</i> = QString(), const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>dir</i> = QString(), const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>filter</i> = QString(), <span class="type"><a href="../qtcore/qstring.html">QString</a></span> *<i>selectedFilter</i> = Q_NULLPTR, <span class="type"><a href="qfiledialog.html#Option-enum">Options</a></span> <i>options</i> = Options())</h3>
<p>This is a convenience static function that will return a file name selected by the user. The file does not have to exist.</p>
<p>It creates a modal file dialog with the given <i>parent</i> widget. If <i>parent</i> is not 0, the dialog will be shown centered over the parent widget.</p>
<pre class="cpp">

  <span class="type"><a href="../qtcore/qstring.html">QString</a></span> fileName <span class="operator">=</span> <span class="type"><a href="qfiledialog.html#QFileDialog">QFileDialog</a></span><span class="operator">::</span>getSaveFileName(<span class="keyword">this</span><span class="operator">,</span> tr(<span class="string">&quot;Save File&quot;</span>)<span class="operator">,</span>
                             <span class="string">&quot;/home/jana/untitled.png&quot;</span><span class="operator">,</span>
                             tr(<span class="string">&quot;Images (*.png *.xpm *.jpg)&quot;</span>));

</pre>
<p>The file dialog's working directory will be set to <i>dir</i>. If <i>dir</i> includes a file name, the file will be selected. Only files that match the <i>filter</i> are shown. The filter selected is set to <i>selectedFilter</i>. The parameters <i>dir</i>, <i>selectedFilter</i>, and <i>filter</i> may be empty strings. Multiple filters are separated with ';;'. For instance:</p>
<pre class="cpp">

  <span class="string">&quot;Images (*.png *.xpm *.jpg);;Text files (*.txt);;XML files (*.xml)&quot;</span>

</pre>
<p>The <i>options</i> argument holds various options about how to run the dialog, see the <a href="qfiledialog.html#Option-enum">QFileDialog::Option</a> enum for more information on the flags you can pass.</p>
<p>The default filter can be chosen by setting <i>selectedFilter</i> to the desired value.</p>
<p>The dialog's caption is set to <i>caption</i>. If <i>caption</i> is not specified, a default caption will be used.</p>
<p>On Windows, and macOS, this static function will use the native file dialog and not a <a href="qfiledialog.html">QFileDialog</a>.</p>
<p>On Windows the dialog will spin a blocking modal event loop that will not dispatch any QTimers, and if <i>parent</i> is not 0 then it will position the dialog just below the parent's title bar. On macOS, with its native file dialog, the filter argument is ignored.</p>
<p>On Unix/X11, the normal behavior of the file dialog is to resolve and follow symlinks. For example, if <code>/usr/tmp</code> is a symlink to <code>/var/tmp</code>, the file dialog will change to <code>/var/tmp</code> after entering <code>/usr/tmp</code>. If <i>options</i> includes <a href="qfiledialog.html#Option-enum">DontResolveSymlinks</a> the file dialog will treat symlinks as regular directories.</p>
<p><b>Warning:</b> Do not delete <i>parent</i> during the execution of the dialog. If you want to do this, you should create the dialog yourself using one of the <a href="qfiledialog.html">QFileDialog</a> constructors.</p>
<p><b>See also </b><a href="qfiledialog.html#getOpenFileName">getOpenFileName</a>(), <a href="qfiledialog.html#getOpenFileNames">getOpenFileNames</a>(), and <a href="qfiledialog.html#getExistingDirectory">getExistingDirectory</a>().</p>
<!-- @@@getSaveFileName -->
<!-- $$$getSaveFileUrl[overload1]$$$getSaveFileUrlQWidget*constQString&constQUrl&constQString&QString*OptionsconstQStringList& -->
<h3 class="fn" id="getSaveFileUrl"><a name="getSaveFileUrl"></a><code>[static] </code><span class="type"><a href="../qtcore/qurl.html">QUrl</a></span> QFileDialog::<span class="name">getSaveFileUrl</span>(<span class="type"><a href="qwidget.html#QWidget">QWidget</a></span> *<i>parent</i> = Q_NULLPTR, const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>caption</i> = QString(), const <span class="type"><a href="../qtcore/qurl.html">QUrl</a></span> &amp;<i>dir</i> = QUrl(), const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>filter</i> = QString(), <span class="type"><a href="../qtcore/qstring.html">QString</a></span> *<i>selectedFilter</i> = Q_NULLPTR, <span class="type"><a href="qfiledialog.html#Option-enum">Options</a></span> <i>options</i> = Options(), const <span class="type"><a href="../qtcore/qstringlist.html">QStringList</a></span> &amp;<i>supportedSchemes</i> = QStringList())</h3>
<p>This is a convenience static function that returns a file selected by the user. The file does not have to exist. If the user presses Cancel, it returns an empty url.</p>
<p>The function is used similarly to <a href="qfiledialog.html#getSaveFileName">QFileDialog::getSaveFileName</a>(). In particular <i>parent</i>, <i>caption</i>, <i>dir</i>, <i>filter</i>, <i>selectedFilter</i> and <i>options</i> are used in the exact same way.</p>
<p>The main difference with <a href="qfiledialog.html#getSaveFileName">QFileDialog::getSaveFileName</a>() comes from the ability offered to the user to select a remote file. That's why the return type and the type of <i>dir</i> is <a href="../qtcore/qurl.html">QUrl</a>.</p>
<p>The <i>supportedSchemes</i> argument allows to restrict the type of URLs the user will be able to select. It is a way for the application to declare the protocols it will support to save the file content. An empty list means that no restriction is applied (the default). Supported for local files (&quot;file&quot; scheme) is implicit and always enabled; it is not necessary to include it in the restriction.</p>
<p>When possible, this static function will use the native file dialog and not a <a href="qfiledialog.html">QFileDialog</a>. On platforms which don't support selecting remote files, Qt will allow to select only local files.</p>
<p>This function was introduced in  Qt 5.2.</p>
<p><b>See also </b><a href="qfiledialog.html#getSaveFileName">getSaveFileName</a>(), <a href="qfiledialog.html#getOpenFileUrl">getOpenFileUrl</a>(), <a href="qfiledialog.html#getOpenFileUrls">getOpenFileUrls</a>(), and <a href="qfiledialog.html#getExistingDirectoryUrl">getExistingDirectoryUrl</a>().</p>
<!-- @@@getSaveFileUrl -->
<!-- $$$history[overload1]$$$history -->
<h3 class="fn" id="history"><a name="history"></a><span class="type"><a href="../qtcore/qstringlist.html">QStringList</a></span> QFileDialog::<span class="name">history</span>() const</h3>
<p>Returns the browsing history of the filedialog as a list of paths.</p>
<p><b>See also </b><a href="qfiledialog.html#setHistory">setHistory</a>().</p>
<!-- @@@history -->
<!-- $$$iconProvider[overload1]$$$iconProvider -->
<h3 class="fn" id="iconProvider"><a name="iconProvider"></a><span class="type"><a href="qfileiconprovider.html">QFileIconProvider</a></span> *QFileDialog::<span class="name">iconProvider</span>() const</h3>
<p>Returns the icon provider used by the filedialog.</p>
<p><b>See also </b><a href="qfiledialog.html#setIconProvider">setIconProvider</a>().</p>
<!-- @@@iconProvider -->
<!-- $$$itemDelegate[overload1]$$$itemDelegate -->
<h3 class="fn" id="itemDelegate"><a name="itemDelegate"></a><span class="type"><a href="qabstractitemdelegate.html">QAbstractItemDelegate</a></span> *QFileDialog::<span class="name">itemDelegate</span>() const</h3>
<p>Returns the item delegate used to render the items in the views in the filedialog.</p>
<p><b>See also </b><a href="qfiledialog.html#setItemDelegate">setItemDelegate</a>().</p>
<!-- @@@itemDelegate -->
<!-- $$$labelText[overload1]$$$labelTextDialogLabel -->
<h3 class="fn" id="labelText"><a name="labelText"></a><span class="type"><a href="../qtcore/qstring.html">QString</a></span> QFileDialog::<span class="name">labelText</span>(<span class="type"><a href="qfiledialog.html#DialogLabel-enum">DialogLabel</a></span> <i>label</i>) const</h3>
<p>Returns the text shown in the filedialog in the specified <i>label</i>.</p>
<p><b>See also </b><a href="qfiledialog.html#setLabelText">setLabelText</a>().</p>
<!-- @@@labelText -->
<!-- $$$mimeTypeFilters[overload1]$$$mimeTypeFilters -->
<h3 class="fn" id="mimeTypeFilters"><a name="mimeTypeFilters"></a><span class="type"><a href="../qtcore/qstringlist.html">QStringList</a></span> QFileDialog::<span class="name">mimeTypeFilters</span>() const</h3>
<p>Returns the MIME type filters that are in operation on this file dialog.</p>
<p>This function was introduced in  Qt 5.2.</p>
<p><b>See also </b><a href="qfiledialog.html#setMimeTypeFilters">setMimeTypeFilters</a>().</p>
<!-- @@@mimeTypeFilters -->
<!-- $$$nameFilters[overload1]$$$nameFilters -->
<h3 class="fn" id="nameFilters"><a name="nameFilters"></a><span class="type"><a href="../qtcore/qstringlist.html">QStringList</a></span> QFileDialog::<span class="name">nameFilters</span>() const</h3>
<p>Returns the file type filters that are in operation on this file dialog.</p>
<p>This function was introduced in  Qt 4.4.</p>
<p><b>See also </b><a href="qfiledialog.html#setNameFilters">setNameFilters</a>().</p>
<!-- @@@nameFilters -->
<!-- $$$open[overload1]$$$openQObject*constchar* -->
<h3 class="fn" id="open"><a name="open"></a><span class="type">void</span> QFileDialog::<span class="name">open</span>(<span class="type"><a href="../qtcore/qobject.html#QObject">QObject</a></span> *<i>receiver</i>, const <span class="type">char</span> *<i>member</i>)</h3>
<p>This is an overloaded function.</p>
<p>This function connects one of its signals to the slot specified by <i>receiver</i> and <i>member</i>. The specific signal depends is <a href="qfiledialog.html#filesSelected">filesSelected</a>() if <a href="qfiledialog.html#fileMode-prop">fileMode</a> is <a href="qfiledialog.html#FileMode-enum">ExistingFiles</a> and <a href="qfiledialog.html#fileSelected">fileSelected</a>() if <a href="qfiledialog.html#fileMode-prop">fileMode</a> is anything else.</p>
<p>The signal will be disconnected from the slot when the dialog is closed.</p>
<p>This function was introduced in  Qt 4.5.</p>
<!-- @@@open -->
<!-- $$$proxyModel[overload1]$$$proxyModel -->
<h3 class="fn" id="proxyModel"><a name="proxyModel"></a><span class="type"><a href="../qtcore/qabstractproxymodel.html">QAbstractProxyModel</a></span> *QFileDialog::<span class="name">proxyModel</span>() const</h3>
<p>Returns the proxy model used by the file dialog. By default no proxy is set.</p>
<p><b>See also </b><a href="qfiledialog.html#setProxyModel">setProxyModel</a>().</p>
<!-- @@@proxyModel -->
<!-- $$$restoreState[overload1]$$$restoreStateconstQByteArray& -->
<h3 class="fn" id="restoreState"><a name="restoreState"></a><span class="type">bool</span> QFileDialog::<span class="name">restoreState</span>(const <span class="type"><a href="../qtcore/qbytearray.html">QByteArray</a></span> &amp;<i>state</i>)</h3>
<p>Restores the dialogs's layout, history and current directory to the <i>state</i> specified.</p>
<p>Typically this is used in conjunction with <a href="../qtcore/qsettings.html">QSettings</a> to restore the size from a past session.</p>
<p>Returns <code>false</code> if there are errors</p>
<p>This function was introduced in  Qt 4.3.</p>
<!-- @@@restoreState -->
<!-- $$$saveState[overload1]$$$saveState -->
<h3 class="fn" id="saveState"><a name="saveState"></a><span class="type"><a href="../qtcore/qbytearray.html">QByteArray</a></span> QFileDialog::<span class="name">saveState</span>() const</h3>
<p>Saves the state of the dialog's layout, history and current directory.</p>
<p>Typically this is used in conjunction with <a href="../qtcore/qsettings.html">QSettings</a> to remember the size for a future session. A version number is stored as part of the data.</p>
<p>This function was introduced in  Qt 4.3.</p>
<!-- @@@saveState -->
<!-- $$$selectFile[overload1]$$$selectFileconstQString& -->
<h3 class="fn" id="selectFile"><a name="selectFile"></a><span class="type">void</span> QFileDialog::<span class="name">selectFile</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>filename</i>)</h3>
<p>Selects the given <i>filename</i> in the file dialog.</p>
<p><b>See also </b><a href="qfiledialog.html#selectedFiles">selectedFiles</a>().</p>
<!-- @@@selectFile -->
<!-- $$$selectMimeTypeFilter[overload1]$$$selectMimeTypeFilterconstQString& -->
<h3 class="fn" id="selectMimeTypeFilter"><a name="selectMimeTypeFilter"></a><span class="type">void</span> QFileDialog::<span class="name">selectMimeTypeFilter</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>filter</i>)</h3>
<p>Sets the current MIME type <i>filter</i>.</p>
<p>This function was introduced in  Qt 5.2.</p>
<!-- @@@selectMimeTypeFilter -->
<!-- $$$selectNameFilter[overload1]$$$selectNameFilterconstQString& -->
<h3 class="fn" id="selectNameFilter"><a name="selectNameFilter"></a><span class="type">void</span> QFileDialog::<span class="name">selectNameFilter</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>filter</i>)</h3>
<p>Sets the current file type <i>filter</i>. Multiple filters can be passed in <i>filter</i> by separating them with semicolons or spaces.</p>
<p>This function was introduced in  Qt 4.4.</p>
<p><b>See also </b><a href="qfiledialog.html#setNameFilter">setNameFilter</a>(), <a href="qfiledialog.html#setNameFilters">setNameFilters</a>(), and <a href="qfiledialog.html#selectedNameFilter">selectedNameFilter</a>().</p>
<!-- @@@selectNameFilter -->
<!-- $$$selectUrl[overload1]$$$selectUrlconstQUrl& -->
<h3 class="fn" id="selectUrl"><a name="selectUrl"></a><span class="type">void</span> QFileDialog::<span class="name">selectUrl</span>(const <span class="type"><a href="../qtcore/qurl.html">QUrl</a></span> &amp;<i>url</i>)</h3>
<p>Selects the given <i>url</i> in the file dialog.</p>
<p><b>Note: </b>The non-native <a href="qfiledialog.html">QFileDialog</a> supports only local files.</p><p>This function was introduced in  Qt 5.2.</p>
<p><b>See also </b><a href="qfiledialog.html#selectedUrls">selectedUrls</a>().</p>
<!-- @@@selectUrl -->
<!-- $$$selectedFiles[overload1]$$$selectedFiles -->
<h3 class="fn" id="selectedFiles"><a name="selectedFiles"></a><span class="type"><a href="../qtcore/qstringlist.html">QStringList</a></span> QFileDialog::<span class="name">selectedFiles</span>() const</h3>
<p>Returns a list of strings containing the absolute paths of the selected files in the dialog. If no files are selected, or the mode is not <a href="qfiledialog.html#FileMode-enum">ExistingFiles</a> or <a href="qfiledialog.html#FileMode-enum">ExistingFile</a>, selectedFiles() contains the current path in the viewport.</p>
<p><b>See also </b><a href="qfiledialog.html#selectedNameFilter">selectedNameFilter</a>() and <a href="qfiledialog.html#selectFile">selectFile</a>().</p>
<!-- @@@selectedFiles -->
<!-- $$$selectedMimeTypeFilter[overload1]$$$selectedMimeTypeFilter -->
<h3 class="fn" id="selectedMimeTypeFilter"><a name="selectedMimeTypeFilter"></a><span class="type"><a href="../qtcore/qstring.html">QString</a></span> QFileDialog::<span class="name">selectedMimeTypeFilter</span>() const</h3>
<p>Returns The mimetype of the file that the user selected in the file dialog.</p>
<p>This function was introduced in  Qt 5.9.</p>
<!-- @@@selectedMimeTypeFilter -->
<!-- $$$selectedNameFilter[overload1]$$$selectedNameFilter -->
<h3 class="fn" id="selectedNameFilter"><a name="selectedNameFilter"></a><span class="type"><a href="../qtcore/qstring.html">QString</a></span> QFileDialog::<span class="name">selectedNameFilter</span>() const</h3>
<p>Returns the filter that the user selected in the file dialog.</p>
<p>This function was introduced in  Qt 4.4.</p>
<p><b>See also </b><a href="qfiledialog.html#selectedFiles">selectedFiles</a>().</p>
<!-- @@@selectedNameFilter -->
<!-- $$$selectedUrls[overload1]$$$selectedUrls -->
<h3 class="fn" id="selectedUrls"><a name="selectedUrls"></a><span class="type"><a href="../qtcore/qlist.html">QList</a></span>&lt;<span class="type"><a href="../qtcore/qurl.html">QUrl</a></span>&gt; QFileDialog::<span class="name">selectedUrls</span>() const</h3>
<p>Returns a list of urls containing the selected files in the dialog. If no files are selected, or the mode is not <a href="qfiledialog.html#FileMode-enum">ExistingFiles</a> or <a href="qfiledialog.html#FileMode-enum">ExistingFile</a>, selectedUrls() contains the current path in the viewport.</p>
<p>This function was introduced in  Qt 5.2.</p>
<p><b>See also </b><a href="qfiledialog.html#selectedNameFilter">selectedNameFilter</a>() and <a href="qfiledialog.html#selectUrl">selectUrl</a>().</p>
<!-- @@@selectedUrls -->
<!-- $$$setDirectory[overload1]$$$setDirectoryconstQString& -->
<h3 class="fn" id="setDirectory"><a name="setDirectory"></a><span class="type">void</span> QFileDialog::<span class="name">setDirectory</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>directory</i>)</h3>
<p>Sets the file dialog's current <i>directory</i>.</p>
<p><b>Note: </b>On iOS, if you set <i>directory</i> to <a href="../qtcore/qstandardpaths.html#standardLocations">QStandardPaths::standardLocations(QStandardPaths::PicturesLocation).last()</a>, a native image picker dialog will be used for accessing the user's photo album. The filename returned can be loaded using <a href="../qtcore/qfile.html">QFile</a> and related APIs. For this to be enabled, the Info.plist assigned to <a href="../qmake/qmake-variable-reference.html#qmake-info-plist">QMAKE_INFO_PLIST</a> in the project file must contain the key <code>NSPhotoLibraryUsageDescription</code>. See Info.plist documentation from Apple for more information regarding this key. This feature was added in Qt 5.5&#x2e;</p><p><b>See also </b><a href="qfiledialog.html#directory">directory</a>().</p>
<!-- @@@setDirectory -->
<!-- $$$setDirectory$$$setDirectoryconstQDir& -->
<h3 class="fn" id="setDirectory-1"><a name="setDirectory-1"></a><span class="type">void</span> QFileDialog::<span class="name">setDirectory</span>(const <span class="type"><a href="../qtcore/qdir.html">QDir</a></span> &amp;<i>directory</i>)</h3>
<p>This is an overloaded function.</p>
<!-- @@@setDirectory -->
<!-- $$$setDirectoryUrl[overload1]$$$setDirectoryUrlconstQUrl& -->
<h3 class="fn" id="setDirectoryUrl"><a name="setDirectoryUrl"></a><span class="type">void</span> QFileDialog::<span class="name">setDirectoryUrl</span>(const <span class="type"><a href="../qtcore/qurl.html">QUrl</a></span> &amp;<i>directory</i>)</h3>
<p>Sets the file dialog's current <i>directory</i> url.</p>
<p><b>Note: </b>The non-native <a href="qfiledialog.html">QFileDialog</a> supports only local files.</p><p><b>Note: </b>On Windows, it is possible to pass URLs representing one of the <i>virtual folders</i>, such as &quot;Computer&quot; or &quot;Network&quot;. This is done by passing a <a href="../qtcore/qurl.html">QUrl</a> using the scheme <code>clsid</code> followed by the CLSID value with the curly braces removed. For example the URL <code>clsid:374DE290-123F-4565-9164-39C4925E467B</code> denotes the download location. For a complete list of possible values, see the MSDN documentation on <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/dd378457.aspx">KNOWNFOLDERID</a>. This feature was added in Qt 5.5&#x2e;</p><p>This function was introduced in  Qt 5.2.</p>
<p><b>See also </b><a href="qfiledialog.html#directoryUrl">directoryUrl</a>() and <a href="../qtcore/quuid.html">QUuid</a>.</p>
<!-- @@@setDirectoryUrl -->
<!-- $$$setFilter[overload1]$$$setFilterQDir::Filters -->
<h3 class="fn" id="setFilter"><a name="setFilter"></a><span class="type">void</span> QFileDialog::<span class="name">setFilter</span>(<span class="type"><a href="../qtcore/qdir.html#Filter-enum">QDir::Filters</a></span> <i>filters</i>)</h3>
<p>Sets the filter used by the model to <i>filters</i>. The filter is used to specify the kind of files that should be shown.</p>
<p>This function was introduced in  Qt 4.4.</p>
<p><b>See also </b><a href="qfiledialog.html#filter">filter</a>().</p>
<!-- @@@setFilter -->
<!-- $$$setHistory[overload1]$$$setHistoryconstQStringList& -->
<h3 class="fn" id="setHistory"><a name="setHistory"></a><span class="type">void</span> QFileDialog::<span class="name">setHistory</span>(const <span class="type"><a href="../qtcore/qstringlist.html">QStringList</a></span> &amp;<i>paths</i>)</h3>
<p>Sets the browsing history of the filedialog to contain the given <i>paths</i>.</p>
<p><b>See also </b><a href="qfiledialog.html#history">history</a>().</p>
<!-- @@@setHistory -->
<!-- $$$setIconProvider[overload1]$$$setIconProviderQFileIconProvider* -->
<h3 class="fn" id="setIconProvider"><a name="setIconProvider"></a><span class="type">void</span> QFileDialog::<span class="name">setIconProvider</span>(<span class="type"><a href="qfileiconprovider.html">QFileIconProvider</a></span> *<i>provider</i>)</h3>
<p>Sets the icon provider used by the filedialog to the specified <i>provider</i>.</p>
<p><b>See also </b><a href="qfiledialog.html#iconProvider">iconProvider</a>().</p>
<!-- @@@setIconProvider -->
<!-- $$$setItemDelegate[overload1]$$$setItemDelegateQAbstractItemDelegate* -->
<h3 class="fn" id="setItemDelegate"><a name="setItemDelegate"></a><span class="type">void</span> QFileDialog::<span class="name">setItemDelegate</span>(<span class="type"><a href="qabstractitemdelegate.html">QAbstractItemDelegate</a></span> *<i>delegate</i>)</h3>
<p>Sets the item delegate used to render items in the views in the file dialog to the given <i>delegate</i>.</p>
<p><b>Warning:</b> You should not share the same instance of a delegate between views. Doing so can cause incorrect or unintuitive editing behavior since each view connected to a given delegate may receive the <a href="qabstractitemdelegate.html#closeEditor">closeEditor()</a> signal, and attempt to access, modify or close an editor that has already been closed.</p>
<p>Note that the model used is <a href="qfilesystemmodel.html">QFileSystemModel</a>. It has custom item data roles, which is described by the <a href="qfilesystemmodel.html#Roles-enum">Roles</a> enum. You can use a <a href="qfileiconprovider.html">QFileIconProvider</a> if you only want custom icons.</p>
<p><b>See also </b><a href="qfiledialog.html#itemDelegate">itemDelegate</a>(), <a href="qfiledialog.html#setIconProvider">setIconProvider</a>(), and <a href="qfilesystemmodel.html">QFileSystemModel</a>.</p>
<!-- @@@setItemDelegate -->
<!-- $$$setLabelText[overload1]$$$setLabelTextDialogLabelconstQString& -->
<h3 class="fn" id="setLabelText"><a name="setLabelText"></a><span class="type">void</span> QFileDialog::<span class="name">setLabelText</span>(<span class="type"><a href="qfiledialog.html#DialogLabel-enum">DialogLabel</a></span> <i>label</i>, const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>text</i>)</h3>
<p>Sets the <i>text</i> shown in the filedialog in the specified <i>label</i>.</p>
<p><b>See also </b><a href="qfiledialog.html#labelText">labelText</a>().</p>
<!-- @@@setLabelText -->
<!-- $$$setMimeTypeFilters[overload1]$$$setMimeTypeFiltersconstQStringList& -->
<h3 class="fn" id="setMimeTypeFilters"><a name="setMimeTypeFilters"></a><span class="type">void</span> QFileDialog::<span class="name">setMimeTypeFilters</span>(const <span class="type"><a href="../qtcore/qstringlist.html">QStringList</a></span> &amp;<i>filters</i>)</h3>
<p>Sets the <i>filters</i> used in the file dialog, from a list of MIME types.</p>
<p>Convenience method for <a href="qfiledialog.html#setNameFilters">setNameFilters</a>(). Uses <a href="../qtcore/qmimetype.html">QMimeType</a> to create a name filter from the glob patterns and description defined in each MIME type.</p>
<p>Use application/octet-stream for the &quot;All files (*)&quot; filter, since that is the base MIME type for all files.</p>
<p>Calling setMimeTypeFilters overrides any previously set name filters, and changes the return value of <a href="qfiledialog.html#nameFilters">nameFilters</a>().</p>
<pre class="cpp">

  <span class="type"><a href="../qtcore/qstringlist.html">QStringList</a></span> mimeTypeFilters;
  mimeTypeFilters <span class="operator">&lt;</span><span class="operator">&lt;</span> <span class="string">&quot;image/jpeg&quot;</span> <span class="comment">// will show &quot;JPEG image (*.jpeg *.jpg *.jpe)</span>
              <span class="operator">&lt;</span><span class="operator">&lt;</span> <span class="string">&quot;image/png&quot;</span>  <span class="comment">// will show &quot;PNG image (*.png)&quot;</span>
              <span class="operator">&lt;</span><span class="operator">&lt;</span> <span class="string">&quot;application/octet-stream&quot;</span>; <span class="comment">// will show &quot;All files (*)&quot;</span>

  <span class="type"><a href="qfiledialog.html#QFileDialog">QFileDialog</a></span> dialog(<span class="keyword">this</span>);
  dialog<span class="operator">.</span>setMimeTypeFilters(mimeTypeFilters);
  dialog<span class="operator">.</span>exec();

</pre>
<p>This function was introduced in  Qt 5.2.</p>
<p><b>See also </b><a href="qfiledialog.html#mimeTypeFilters">mimeTypeFilters</a>().</p>
<!-- @@@setMimeTypeFilters -->
<!-- $$$setNameFilter[overload1]$$$setNameFilterconstQString& -->
<h3 class="fn" id="setNameFilter"><a name="setNameFilter"></a><span class="type">void</span> QFileDialog::<span class="name">setNameFilter</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>filter</i>)</h3>
<p>Sets the filter used in the file dialog to the given <i>filter</i>.</p>
<p>If <i>filter</i> contains a pair of parentheses containing one or more filename-wildcard patterns, separated by spaces, then only the text contained in the parentheses is used as the filter. This means that these calls are all equivalent:</p>
<pre class="cpp">

  dialog<span class="operator">.</span>setNameFilter(<span class="string">&quot;All C++ files (*.cpp *.cc *.C *.cxx *.c++)&quot;</span>);
  dialog<span class="operator">.</span>setNameFilter(<span class="string">&quot;*.cpp *.cc *.C *.cxx *.c++&quot;</span>);

</pre>
<p>This function was introduced in  Qt 4.4.</p>
<p><b>See also </b><a href="qfiledialog.html#setMimeTypeFilters">setMimeTypeFilters</a>() and <a href="qfiledialog.html#setNameFilters">setNameFilters</a>().</p>
<!-- @@@setNameFilter -->
<!-- $$$setNameFilters[overload1]$$$setNameFiltersconstQStringList& -->
<h3 class="fn" id="setNameFilters"><a name="setNameFilters"></a><span class="type">void</span> QFileDialog::<span class="name">setNameFilters</span>(const <span class="type"><a href="../qtcore/qstringlist.html">QStringList</a></span> &amp;<i>filters</i>)</h3>
<p>Sets the <i>filters</i> used in the file dialog.</p>
<p>Note that the filter <b>*.*</b> is not portable, because the historical assumption that the file extension determines the file type is not consistent on every operating system. It is possible to have a file with no dot in its name (for example, <code>Makefile</code>). In a native Windows file dialog, <b>*.*</b> will match such files, while in other types of file dialogs it may not. So it is better to use <b>*</b> if you mean to select any file.</p>
<pre class="cpp">

  <span class="type"><a href="../qtcore/qstringlist.html">QStringList</a></span> filters;
  filters <span class="operator">&lt;</span><span class="operator">&lt;</span> <span class="string">&quot;Image files (*.png *.xpm *.jpg)&quot;</span>
          <span class="operator">&lt;</span><span class="operator">&lt;</span> <span class="string">&quot;Text files (*.txt)&quot;</span>
          <span class="operator">&lt;</span><span class="operator">&lt;</span> <span class="string">&quot;Any files (*)&quot;</span>;

  <span class="type"><a href="qfiledialog.html#QFileDialog">QFileDialog</a></span> dialog(<span class="keyword">this</span>);
  dialog<span class="operator">.</span>setNameFilters(filters);
  dialog<span class="operator">.</span>exec();

</pre>
<p><a href="qfiledialog.html#setMimeTypeFilters">setMimeTypeFilters</a>() has the advantage of providing all possible name filters for each file type. For example, JPEG images have three possible extensions; if your application can open such files, selecting the <code>image/jpeg</code> mime type as a filter will allow you to open all of them.</p>
<p>This function was introduced in  Qt 4.4.</p>
<p><b>See also </b><a href="qfiledialog.html#nameFilters">nameFilters</a>().</p>
<!-- @@@setNameFilters -->
<!-- $$$setOption[overload1]$$$setOptionOptionbool -->
<h3 class="fn" id="setOption"><a name="setOption"></a><span class="type">void</span> QFileDialog::<span class="name">setOption</span>(<span class="type"><a href="qfiledialog.html#Option-enum">Option</a></span> <i>option</i>, <span class="type">bool</span> <i>on</i> = true)</h3>
<p>Sets the given <i>option</i> to be enabled if <i>on</i> is true; otherwise, clears the given <i>option</i>.</p>
<p>This function was introduced in  Qt 4.5.</p>
<p><b>See also </b><a href="qfiledialog.html#options-prop">options</a> and <a href="qfiledialog.html#testOption">testOption</a>().</p>
<!-- @@@setOption -->
<!-- $$$setProxyModel[overload1]$$$setProxyModelQAbstractProxyModel* -->
<h3 class="fn" id="setProxyModel"><a name="setProxyModel"></a><span class="type">void</span> QFileDialog::<span class="name">setProxyModel</span>(<span class="type"><a href="../qtcore/qabstractproxymodel.html">QAbstractProxyModel</a></span> *<i>proxyModel</i>)</h3>
<p>Sets the model for the views to the given <i>proxyModel</i>. This is useful if you want to modify the underlying model; for example, to add columns, filter data or add drives.</p>
<p>Any existing proxy model will be removed, but not deleted. The file dialog will take ownership of the <i>proxyModel</i>.</p>
<p>This function was introduced in  Qt 4.3.</p>
<p><b>See also </b><a href="qfiledialog.html#proxyModel">proxyModel</a>().</p>
<!-- @@@setProxyModel -->
<!-- $$$setSidebarUrls[overload1]$$$setSidebarUrlsconstQList<QUrl>& -->
<h3 class="fn" id="setSidebarUrls"><a name="setSidebarUrls"></a><span class="type">void</span> QFileDialog::<span class="name">setSidebarUrls</span>(const <span class="type"><a href="../qtcore/qlist.html">QList</a></span>&lt;<span class="type"><a href="../qtcore/qurl.html">QUrl</a></span>&gt; &amp;<i>urls</i>)</h3>
<p>Sets the <i>urls</i> that are located in the sidebar.</p>
<p>For instance:</p>
<pre class="cpp">

      <span class="type"><a href="../qtcore/qlist.html">QList</a></span><span class="operator">&lt;</span><span class="type"><a href="../qtcore/qurl.html">QUrl</a></span><span class="operator">&gt;</span> urls;
      urls <span class="operator">&lt;</span><span class="operator">&lt;</span> <span class="type"><a href="../qtcore/qurl.html">QUrl</a></span><span class="operator">::</span>fromLocalFile(<span class="string">&quot;/Users/foo/Code/qt5&quot;</span>)
           <span class="operator">&lt;</span><span class="operator">&lt;</span> <span class="type"><a href="../qtcore/qurl.html">QUrl</a></span><span class="operator">::</span>fromLocalFile(<span class="type"><a href="../qtcore/qstandardpaths.html">QStandardPaths</a></span><span class="operator">::</span>standardLocations(<span class="type"><a href="../qtcore/qstandardpaths.html">QStandardPaths</a></span><span class="operator">::</span>MusicLocation)<span class="operator">.</span>first());

      <span class="type"><a href="qfiledialog.html#QFileDialog">QFileDialog</a></span> dialog;
      dialog<span class="operator">.</span>setSidebarUrls(urls);
      dialog<span class="operator">.</span>setFileMode(<span class="type"><a href="qfiledialog.html#QFileDialog">QFileDialog</a></span><span class="operator">::</span>AnyFile);
      <span class="keyword">if</span>(dialog<span class="operator">.</span>exec()) {
          <span class="comment">// ...</span>
      }

</pre>
<p>The file dialog will then look like this:</p>
<p class="centerAlign"><img src="images/filedialogurls.png" alt="" /></p><p>This function was introduced in  Qt 4.3.</p>
<p><b>See also </b><a href="qfiledialog.html#sidebarUrls">sidebarUrls</a>().</p>
<!-- @@@setSidebarUrls -->
<!-- $$$setVisible[overload1]$$$setVisiblebool -->
<h3 class="fn" id="setVisible"><a name="setVisible"></a><code>[virtual] </code><span class="type">void</span> QFileDialog::<span class="name">setVisible</span>(<span class="type">bool</span> <i>visible</i>)</h3>
<p>Reimplemented from <a href="qwidget.html#visible-prop">QWidget::setVisible</a>().</p>
<!-- @@@setVisible -->
<!-- $$$sidebarUrls[overload1]$$$sidebarUrls -->
<h3 class="fn" id="sidebarUrls"><a name="sidebarUrls"></a><span class="type"><a href="../qtcore/qlist.html">QList</a></span>&lt;<span class="type"><a href="../qtcore/qurl.html">QUrl</a></span>&gt; QFileDialog::<span class="name">sidebarUrls</span>() const</h3>
<p>Returns a list of urls that are currently in the sidebar</p>
<p>This function was introduced in  Qt 4.3.</p>
<p><b>See also </b><a href="qfiledialog.html#setSidebarUrls">setSidebarUrls</a>().</p>
<!-- @@@sidebarUrls -->
<!-- $$$testOption[overload1]$$$testOptionOption -->
<h3 class="fn" id="testOption"><a name="testOption"></a><span class="type">bool</span> QFileDialog::<span class="name">testOption</span>(<span class="type"><a href="qfiledialog.html#Option-enum">Option</a></span> <i>option</i>) const</h3>
<p>Returns <code>true</code> if the given <i>option</i> is enabled; otherwise, returns false.</p>
<p>This function was introduced in  Qt 4.5.</p>
<p><b>See also </b><a href="qfiledialog.html#options-prop">options</a> and <a href="qfiledialog.html#setOption">setOption</a>().</p>
<!-- @@@testOption -->
<!-- $$$urlSelected[overload1]$$$urlSelectedconstQUrl& -->
<h3 class="fn" id="urlSelected"><a name="urlSelected"></a><code>[signal] </code><span class="type">void</span> QFileDialog::<span class="name">urlSelected</span>(const <span class="type"><a href="../qtcore/qurl.html">QUrl</a></span> &amp;<i>url</i>)</h3>
<p>When the selection changes and the dialog is accepted, this signal is emitted with the (possibly empty) selected <i>url</i>.</p>
<p>This function was introduced in  Qt 5.2.</p>
<p><b>See also </b><a href="qfiledialog.html#currentUrlChanged">currentUrlChanged</a>() and <a href="qdialog.html#DialogCode-enum">QDialog::Accepted</a>.</p>
<!-- @@@urlSelected -->
<!-- $$$urlsSelected[overload1]$$$urlsSelectedconstQList<QUrl>& -->
<h3 class="fn" id="urlsSelected"><a name="urlsSelected"></a><code>[signal] </code><span class="type">void</span> QFileDialog::<span class="name">urlsSelected</span>(const <span class="type"><a href="../qtcore/qlist.html">QList</a></span>&lt;<span class="type"><a href="../qtcore/qurl.html">QUrl</a></span>&gt; &amp;<i>urls</i>)</h3>
<p>When the selection changes and the dialog is accepted, this signal is emitted with the (possibly empty) list of selected <i>urls</i>.</p>
<p>This function was introduced in  Qt 5.2.</p>
<p><b>See also </b><a href="qfiledialog.html#currentUrlChanged">currentUrlChanged</a>() and <a href="qdialog.html#DialogCode-enum">QDialog::Accepted</a>.</p>
<!-- @@@urlsSelected -->
</div>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2017 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br>    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. </p>
</div>
</body>
</html>