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

Dialog reacts only to the accepting and rejecting roles of the standard buttons

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P2: Important P2: Important
    • 5.10.0 Alpha
    • 5.8.0, 5.9.0 Alpha
    • Quick: Controls 2
    • None
    • 2b20122b223f7619c7a1ba7b4a4a65194bd2a270

      If we use other roles, Dialog just ignores them. For example, pressing the "Discard" button does nothing:

      Dialog {
          standardButtons: Dialog.Discard | Dialog.Cancel
      
          Label {
              text: "Discard changes?"
          }
      
          onAccepted: {
              // never called
          }
          onRejected: {
              // called on "Cancel" button
          }
      }
      

      To be able to react to buttons, other than with accepting or rejecting roles, one should use custom DialogButtonBox. And there is no reason to be able to set this buttons via the Dialog's standardButtons property.

      So, either we need an additional signal in the Dialog, like clicked() with a button or a button role, or we need to remove some enum values from the standardButtons.

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

            Unassigned Unassigned
            krnekit Nikita Krupenko
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes