Results 1 to 3 of 3

Thread: QTreeView autoscrolling in drag move events

  1. #1
    Join Date
    Feb 2011
    Posts
    354
    Thanks
    17
    Thanked 27 Times in 24 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Windows

    Default QTreeView autoscrolling in drag move events

    I want to implement automatic vertical scrolling in QTreeView when rows are dragged. I set autoScroll and acceptDrops to true, but it doesn't work. How can this be achieved?

  2. #2
    Join Date
    Feb 2011
    Posts
    354
    Thanks
    17
    Thanked 27 Times in 24 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Windows

    Default Re: QTreeView autoscrolling in drag move events

    I found a way to scroll tree view with scrollTo method, only it doesn't seem to be convenient for a user when hint is something other than EnsureVisible, from the other side I can't scroll to the row that is currently invisible when hint = EnsureVisible. Please, suggest me how can I overcome this.

    Also I still don't understand the purpose of autoScroll property. Why do we need it if I have to do all the work manually with scrollTo?

  3. #3
    Join Date
    Feb 2011
    Posts
    354
    Thanks
    17
    Thanked 27 Times in 24 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Windows

    Default Re: QTreeView autoscrolling in drag move events

    Ok, problem solved. I had to call base class method in overriden dragMoveEvent (wanted to mention this for those who may face it too).

  4. The following user says thank you to mentalmushroom for this useful post:

    Fred (26th February 2021)

Similar Threads

  1. Qt move picture per drag and drop
    By Qiieha in forum Qt Programming
    Replies: 0
    Last Post: 14th June 2011, 11:02
  2. move/drag tabified QDockWidget's togeter
    By qtui in forum Qt Programming
    Replies: 0
    Last Post: 14th February 2011, 00:01
  3. Replies: 0
    Last Post: 2nd June 2010, 17:52
  4. move/drag points on qwt plot
    By rambo83 in forum Qwt
    Replies: 5
    Last Post: 23rd November 2009, 08:36
  5. Drag Move
    By Lele in forum Qt Programming
    Replies: 1
    Last Post: 18th August 2006, 13:51

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.