Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Unsolved How to remove the dbclick event on mousearea control

    QML and Qt Quick
    2
    2
    481
    Loading More Posts
    • 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.
    • M
      Mr .Wu last edited by

      How to remove the dbclick event on mousearea control

      1 Reply Last reply Reply Quote 0
      • E
        Eddy last edited by

        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

        Qt Certified Specialist
        www.edalsolutions.be

        1 Reply Last reply Reply Quote 0
        • First post
          Last post