Giter VIP home page Giter VIP logo

listviewdragitem's Introduction

listviewdragitem's People

Contributors

agateau avatar decon4 avatar kindid avatar tanghus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

listviewdragitem's Issues

Delay drag

Hi @agateau

Thanks for this elaborate example! I've been looking for something like this for a long time, and I do love a good cut'n'paste ;)

I've been trying to add a delay to the drag operation, as it is very often triggered when scrolling the ListView on a touch screen.

And it doesn't work. The dragArea is moved immediately, it just blocks the drop until timeout.

        SilicaItem {
            id: contentItemWrapper
            anchors.fill: parent
            //Drag.active: dragArea.drag.active
            Drag.hotSpot {
                x: contentItem.width / 2
                y: contentItem.height / 2
            }
            property bool dragActive: dragArea.drag.active
            property Timer dragDelay: Timer {
                interval: 0
                onTriggered: {
                    console.log("DraggableItem.dragDelay.start")
                    contentItemWrapper.Drag.active = dragArea.drag.active
                }
            }
            onDragActiveChanged: {
                dragDelay.start()
            }
            MouseArea {
                id: dragArea
                anchors.fill: parent
                drag.target: parent
                drag.axis: ListView.orientation === ListView.Horizontal ? Drag.XAxis : Drag.YAxis
                drag.smoothed: false

                onReleased: {
                    if (drag.active) {
                        emitMoveItemRequested();
                    }
                }
            }
        }

Do you have an idea where to delay the drag?

White background

Hi,
Thanks for sharing the DraggableItem. I have been playing around with it but there is one issue: the background is always white (unless I manually insert a rectangle with another color).
Do you have a hint what causes the white background?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.