Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Autoscroll QTreeview only vertically
Qt 6.11 is out! See what's new in the release blog

Autoscroll QTreeview only vertically

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 1.3k Views 1 Watching
  • 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.
  • J Offline
    J Offline
    joorge87
    wrote on last edited by
    #1

    I want to autoscroll while making Drag and drop operations, I know that it can be set by: setAutoScroll(true)

    but it activates autoscrolls in vertical and horizontal direction. Is it a way to activate only the vertical autoscrolling?

    Thank you,
    Jorge

    1 Reply Last reply
    0
    • raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      no there is no such property to limit the directions.

      But you could do the following:

      • disable Qt autoscroll feature
      • install an eventfilter on the viewport
      • on dragmove check if the pos is in a top/bottom margin (defined by you)
      • if yes start a timer which periodically in-/decreases the value of the vertical scrollbar (if visible)
      • stop the timer on drop drag-leave events

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      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