Qt Forum

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

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

    Unsolved Mouse PressAndHold

    QML and Qt Quick
    mousearea buttons
    2
    2
    832
    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.
    • msinger
      msinger last edited by

      Is it possible to disable pressandhold so that no matter how long a mouse area is pressed, I get a clicked signal when released?

      1 Reply Last reply Reply Quote 0
      • I
        istvan last edited by istvan

        In my understanding this is exact what onClicked does. From the online documentation:

        "A click is defined as a press followed by a release, both inside the MouseArea (pressing, moving outside the MouseArea, and then moving back inside and releasing is also considered a click)."

                MouseArea {
                    anchors.fill: parent
                    onClicked: console.log("released")
                    onPressed:  console.log("pressed")
                }
        
        1 Reply Last reply Reply Quote 1
        • First post
          Last post