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

FileDialog doesn't emit the rejected signal when closed by the title bar cross button

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • None
    • 5.10.1
    • Quick: Dialogs
    • None
    • * Qt Quick 2.10 application on Qt 5.10 (installed from binaries)
       * Fedora 26 (KDE)

       

      The (not properly documented) onRejected is not emitted when you close the FileDialog using the title bar cross instead of the Cancel button.

       

      To reproduce this you can use the code below:

      import QtQuick 2.10
      import QtQuick.Controls 2.3
      import QtQuick.Dialogs 1.3
      
      ApplicationWindow {
          visible: true
      
          FileDialog {
              id: fileDialog
              folder: shortcuts.home
              onAccepted: {
                  console.log("You chose: " + fileDialog.fileUrls)
                  Qt.quit()
              }
              onRejected: {
                  console.log("Rejected")
                  Qt.quit()
              }
              Component.onCompleted: visible = true
          }
      }
      
      

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

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            vojtechfrnoch Vojtěch Frnoch
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes