Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. MessageDialog is triggering signals twice

MessageDialog is triggering signals twice

Scheduled Pinned Locked Moved QML and Qt Quick
6 Posts 4 Posters 2.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dmendizabal
    wrote on last edited by
    #1

    I have a problem using MessageDialog. The following code:

    @
    import QtQuick 2.2
    import QtQuick.Dialogs 1.1

    .....

    MessageDialog {
    id: id_dialogDelete
    title: qsTr("Warning");
    icon: StandardIcon.Warning
    text: qsTr("Are you sure?")
    standardButtons: StandardButton.Yes | StandardButton.No
    Component.onCompleted: visible = true

        onYes: {
            console.log("DELETE")
        }
    }@
    

    Triggers yes() signal two times and the result is:

    @DELETE
    DELETE@

    What could be the problem?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      steno
      wrote on last edited by
      #2

      Found this bug.

      "Bug":https://bugreports.qt-project.org/browse/QTBUG-35777

      1 Reply Last reply
      0
      • Q Offline
        Q Offline
        QtTommy
        wrote on last edited by
        #3

        I have a similiar problem. Normaly I create all my userinterfaces without the designer because I'm programming a embedded linux application and my resources are limited. Today I've created a more complex dialog therefore I used the Designer and noticed that a simple QPushButton emitts the signal "clicked()" two times if I use the function in the contextmenu of the designer "go to slot". If I connect the signal with a function by the source code it works! Until now I haven't found the reason for this effect.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          steno
          wrote on last edited by
          #4

          The bug was marked as fixed in qt 5.2.1

          1 Reply Last reply
          0
          • O Offline
            O Offline
            onek24
            wrote on last edited by
            #5

            I will try it out and tell you if it worked.

            -- Update --

            Worked out fine using:

            • Qt Creator 3.0.1
            • QT 5.2.1(MSVC 2010, 32bit) Desktop MinGW 32bit
            • Revision 51af63bb9e
            1 Reply Last reply
            0
            • D Offline
              D Offline
              dmendizabal
              wrote on last edited by
              #6

              Yes, it is working fine now for me as well. I've updated to Qt5.2.1

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved