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]Controlling scrolling in QListView
QtWS25 Last Chance

[Solved]Controlling scrolling in QListView

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 8.3k Views
  • 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.
  • T Offline
    T Offline
    ThaRez
    wrote on last edited by
    #1

    Hello
    I'm wondering how I could control the scrolling in a qlistview so that every time a item is added to the end of the list, it scrolls down. Also I'd like to control the scrolling of the qlistview using function calls (e.g. "scroll one row down"). My last question concerns the scroll bars, how can I disable the horizontal one? Thanks you!
    Best regards
    Richard

    1 Reply Last reply
    0
    • C Offline
      C Offline
      cincirin
      wrote on last edited by
      #2
      1. "QAbstractItemView::scrollToBottom":http://doc.qt.nokia.com/latest/qabstractitemview.html#scrollToBottom

      2. "set QAbstractItemView::ScrollPerItem":http://doc.qt.nokia.com/latest/qabstractitemview.html#verticalScrollMode-prop

      3. "Hide the QAbstractScrollArea::horizontalScrollBar":http://doc.qt.nokia.com/latest/qabstractscrollarea.html#horizontalScrollBar

      1 Reply Last reply
      0
      • B Offline
        B Offline
        broadpeak
        wrote on last edited by
        #3

        @
        if (index.isValid()) {
        //index is your last inserted item in the list
        view->scrollTo(index);
        view->setCurrentIndex(index);
        }
        @

        and

        @
        QAbstractScrollArea ::setHorizontalScrollBarPolicy (Qt::ScrollBarAlwaysOff);
        @

        1 Reply Last reply
        0
        • T Offline
          T Offline
          ThaRez
          wrote on last edited by
          #4

          Thank you! -- Richard

          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