How to remove the dbclick event on mousearea control



  • How to remove the dbclick event on mousearea control


  • Moderators

    Hi,

    You could use a timer like this :

    Window {
        visible: true
        width: 640
        height: 480
    
        MainForm {
            anchors.fill: parent
            Timer{
                id:timer
                interval: 300
                onTriggered: console.log("'Clicked on background. ")
            }
            mouseArea.onClicked: {
                if(timer.running)
                {
                    timer.stop()
                }
                else
                    timer.restart()
            }
        }
    }
    

    This way nothing is going to happen when you doubleclick but still does something when just clicking once.

    Eddy


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.