Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-119916

Non-native FileDialog does not prompt about overwriting an existing file

XMLWordPrintable

    • 1cc20d181 (dev), d340459e7 (6.7), 025c130c1 (6.6), 6e2239381 (tqtc/lts-6.5)
    • G&UI Finishing 2023

      According to https://doc.qt.io/qt-6/qml-qtquick-dialogs-filedialog.html#options-prop, attempting to select an existing file for saving should produce a confirmation prompt about overwriting the file.

      However, this is not the case for the non-native dialog.

       

      Code

      import QtQuick
      import QtQuick.Dialogs
      
      Window {
          width: 640
          height: 480
          visible: true
      
          FileDialog {
              id: dlg
              fileMode: FileDialog.SaveFile
              options: FileDialog.DontUseNativeDialog
              onAccepted: console.log("Selected", selectedFile)
          }
          Component.onCompleted: dlg.open()
      }
      

       

      Expected outcomes
      When you select an existing file, you'll be prompted about overwriting it. This behaviour occurs with the native Windows dialog.

       

      Actual outcomes
      When you select an existing file, no confirmation is requested.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            hurlevent Oliver Eftevaag
            skoh-qt Sze Howe Koh
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes