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

MessageDialog emits accepted signal twice

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Out of scope
    • Affects Version/s: 5.12.8, 5.15.2
    • Fix Version/s: None
    • Component/s: Quick: Dialogs
    • Labels:
      None
    • Environment:
      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
    • Platform/s:
      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

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

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes