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. [SOLVED]Disable automatic scrolling when clicking an item
Forum Updated to NodeBB v4.3 + New Features

[SOLVED]Disable automatic scrolling when clicking an item

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 1.9k 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.
  • S Offline
    S Offline
    Skyrpex
    wrote on last edited by
    #1

    I have a QTreeView with a custom item delegate. The delegate creates an editor that can be very wide (let's say, 2000px width), so the user will scroll it to edit the data.

    !http://imageshack.us/a/img856/7661/image1mt.png(Image 1)!
    I scrolled to the frame #300 and I will click it. Notice that the scrollbar is already offseted.

    !http://imageshack.us/a/img801/9887/image2zb.png(Image 2)!
    Then, the scrollbar goes to the starting position automatically. It happens because the current selected row have changed. Is there any way to disable the automatic scrolling?

    Thanks!

    1 Reply Last reply
    0
    • S Offline
      S Offline
      Skyrpex
      wrote on last edited by
      #2

      Solved with the property "QAbstractItemView::autoScroll":http://doc.qt.nokia.com/4.7-snapshot/qabstractitemview.html#autoScroll-prop. So, all I had to do was to write:
      @myTreeView->setAutoScroll(false);@

      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