Qt World Summit: Submit your Presentation

Drag and drop in treeview with scrollbar problem

  • I need help with this problem:
    I have a treeview in an application that lets you drag and drop treeview of some items for her own. It is not allowed to drop in all the positions in the treeview, and to treat it, check with the event QDragMoveEvent ignore () or acceptProposedAction (). This works, except in one case:
    When the treeview is full of items, the vertical scrollbar appears in it, and drag and position the mouse on top of the treeview scrolls the scroll bar to allow a drop in the positions listed above (or below). When this movement occurs, the mouse can be stopped and changed the items below. The problem is that with the mouse while I'm still waiting for the scrollbar up or down QDragMoveEvent event is not generated, and therefore is not being treated right now if it is allowed to drop in these positions or not, being worth what it was improperly set in the last movement mouse (permitted or not), and sometimes allowing them to drop the item in forbidden positions (or not allowing drop in posiçõesp hermits). Thought to control other event, such as moving the scrollbar, but then I would no longer have the qdragmoveevent I need to accept or reject the drop.
    Any ideas?

Log in to reply