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

MessageDialog emits accepted signal twice

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • P2: Important
    • None
    • 5.12.8, 5.15.2
    • Quick: Dialogs
    • None
    • Qt 5.12.8 packages from Stephan Binner PPA on Kubuntu 18.04 and KDE neon 5.15.2 packages on Kde Neon 20.04 were tested
    • Linux/X11

    Description

      Running the example from https://doc.qt.io/qt-5/qml-qtquick-dialogs-messagedialog.html

      import QtQuick 2.2
      import QtQuick.Dialogs 1.1
      
      MessageDialog {
          id: messageDialog
          title: "May I have your attention please"
          text: "It's so cool that you are using Qt Quick."
          onAccepted: {
              console.log("And of course you could only agree.")
              Qt.quit()
          }
          Component.onCompleted: visible = true
      }

      it prints out the line "And of course you could only agree." twice

      Adding a StandardButton.Cancel I can also see that onCancel is called twice as well

      It happens for both Ok/Enter and Cancel/ESC

       

      This works just fine in 5.12.0

       

       

      Unfortunately the Enter button does not trigger an "accepted" signal in the labs MessageDialog  in 5.12.0 so switching to labs is not a suitable workaround for us

       

      Attachments

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

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            simonschmeisser Simon Schmeisser
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes