MessageDialog is triggering signals twice



  • 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?





  • 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.



  • The bug was marked as fixed in qt 5.2.1



  • 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


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


Log in to reply