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

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

    XMLWordPrintable

Details

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

    Description

      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.

      Attachments

        For Gerrit Dashboard: QTBUG-119916
        # Subject Branch Project Status CR V

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes