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. Scrolling a QTableView via touch
Qt 6.11 is out! See what's new in the release blog

Scrolling a QTableView via touch

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 2.8k 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.
  • Andy314A Offline
    Andy314A Offline
    Andy314
    wrote on last edited by Andy314
    #1
    1. Problem:
      For a QTableView I have configured VerticalScrollMode = ScrollPerItem.
      Therefore it should be possible to scroll the TableView via 2FingerTouch
      This work not correct. It scrolls round about 10 Items by a move of round about 1 table row-height.

    2. Problem:
      I dont like the 2 Finger touchgestures for scroll, so I found the following code:
      QScroller::grabGesture(ui->TableView, QScroller::LeftMouseButtonGesture);
      This enables indeed the touch scrolling feature with on finger.
      This does not work a well. I scrolls much more faster, therefore I think here I scrollPerPixel is used.

    How can I get a "normal" scrolling via touch? Distance of finger move should amount of scrolling.

    raven-worxR 1 Reply Last reply
    0
    • Andy314A Andy314
      1. Problem:
        For a QTableView I have configured VerticalScrollMode = ScrollPerItem.
        Therefore it should be possible to scroll the TableView via 2FingerTouch
        This work not correct. It scrolls round about 10 Items by a move of round about 1 table row-height.

      2. Problem:
        I dont like the 2 Finger touchgestures for scroll, so I found the following code:
        QScroller::grabGesture(ui->TableView, QScroller::LeftMouseButtonGesture);
        This enables indeed the touch scrolling feature with on finger.
        This does not work a well. I scrolls much more faster, therefore I think here I scrollPerPixel is used.

      How can I get a "normal" scrolling via touch? Distance of finger move should amount of scrolling.

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      @Andy314
      try playing around with the QScrollerProperties:

      QScroller::grabGesture(ui->TableView, QScroller::LeftMouseButtonGesture);
      
      QScroller* scroller = QScroller::scroller( ui->TableView );
      QScrollerProperties props = scroller ->scrollerProperties();
      props.setScrollMetric( QScrollerProperties::MaximumVelocity, QVariant::fromValue<qreal>(0.5) );
      // ... take a look at the other properties also
      scroller->setScrollerProperties( props );
      

      --- 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
      1

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved