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. How to disable the drag animation in Mouse area, but i want to handle the yvlaue changes when dragged from 0 to item height

How to disable the drag animation in Mouse area, but i want to handle the yvlaue changes when dragged from 0 to item height

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
qml qml
1 Posts 1 Posters 196 Views
  • 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 Offline
    M Offline
    ManiM
    wrote on last edited by
    #1

    import QtQuick 2.15
    import QtQuick.Window 2.15

    Window {
    width: 640
    height: 480
    visible: true
    title: qsTr("Hello World")

    Item {
        id: _item
        width: 100; height: 50;
    
        Rectangle {
            anchors.fill: parent
            color: "lightblue"
        }
    
        MouseArea {
            id: mouseA
            anchors.fill: parent
            drag.target: _item
            drag.axis: Drag.YAxis
            drag.minimumY: 0
            drag.maximumY: _item.height
    
            property int initialY: _item.height
            property int yValue: _item.y
    
            onYValueChanged: {
                console.log("Mani Y value changed to:"+ yValue +" "+initialY);
                if (drag.active && initialY == yValue){
                    console.log("Mani Y value changed to:"+initialY);
                }
            }
        }
    
    }
    

    }

    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