Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QML ListView Drag'n'Drop Scroll



  • I make Drag'n'Drop items in the ListView list. Everything works fine, only until the moment when you need to move the item, for example at the end of the list, and all items in the view do not fit - you need to skip the interactive scroll.

    An example that goes in Qt delivery without a scroll. Googled a long time, found nothing normal. Including this https://stackoverflow.com/questions/40789412/scroll-items-during-drag-and-drop-an-item

    I tried it myself. For example, by changing the currentIndex property. The timer started when the event was detected. It seems to work, but after a few seconds the item is lost, which is held by the target.

    In general, does anyone have an idea or a ready-made solution?



  • @Vitaliy said in QML ListView Drag'n'Drop Scroll:

    move the item [...] at the end of the list, and all items in the view do not fit - you need to skip the interactive scroll

    What do you mean? You want to drag an item to the end of the list without scrolling even though the view does not show the last item or only shows it partially?

    The timer started when the event was detected

    What timer?

    Post some simple, easily testable (by others) code like in the link you posted. I tested it and it almost works. It seems to require some more tweaking. But at least, the idea in there is clear.


Log in to reply