title: FileDialog is fine is debug mode, but not as expected in release mode
body: <p>A QML <code>FileDialog</code> to save a file works fine in debug mode.</p>
  <p><a href="https://i.stack.imgur.com/RyM6A.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RyM6A.png" alt="Screenshot: debug mode: fine" /></a></p>
  <p>The code is:</p>
  <pre><code>import QtQuick 2.5
  import QtQuick.Controls 2.12
  import QtQuick.Layouts 1.12
  import QtQuick.Dialogs 1.2
  import Qt.labs.settings 1.1
  import QtQuick.Controls.Styles 1.4
  import Qt.labs.platform 1.0
  
  Item {
  
      property string exportSceneName: &quot;exported_scene&quot;
      property url exportFolder: StandardPaths.writableLocation(StandardPaths.DocumentsLocation)
  
      signal  startExport()
  
      onStartExport: {
          runLogic()
      }
  
      function runLogic() {
          // ...
      }
  
      Button {
          onClicked: {
              fileDialog.open()
          }
      }
      
      FileDialog {
          id: fileDialog
          folder: exportFolder
          fileMode: FileDialog.SaveFile
          title: qsTr(&quot;Export Scene As STL&quot;)
          onAccepted: {
              exportFolder = folder
              var name = basename(file)
              exportSceneName = name
              startExport()
          }
      }
  
      function basename(str) {
          return (String(str).slice(String(str).lastIndexOf(&quot;/&quot;)+1))
      }
  
  }
  </code></pre>
  <h3>Release mode</h3>
  <p>Surprisingly, in release mode, the dialog is <em>open</em>-type rather than <em>save</em>-type:</p>
  <p><a href="https://i.stack.imgur.com/NJRvb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NJRvb.png" alt="Screenshot: release mode: bad" /></a></p>
  <p>I have tried:</p>
  <ul>
  <li>Change the QML imports versions</li>
  <li>Clean the release build directory</li>
  <li>Modify <code>qtquickcontrols2.conf</code> file</li>
  </ul>
  <p>However, none of them worked! I have studied similar posts like <a href="https://stackoverflow.com/q/49178542/3405291">this one</a>, but suggestions didn't work. What else can I try? Thanks.</p>
  <h2>SOLUTION</h2>
  <p>Fixed by removing this import inside QML file:</p>
  <pre><code>import QtQuick.Dialogs 1.2
  </code></pre>