Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Solved how to move the horizonal scrollbar in a QTReeView through code

    General and Desktop
    2
    2
    368
    Loading More Posts
    • 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.
    • Q
      Qt Enthusiast last edited by

      Hi all
      I have a QtreevIew in which I have 3 columns , How to can move the horizontal scrollbar using code so that column 2 is visible

      raven-worx 1 Reply Last reply Reply Quote 0
      • raven-worx
        raven-worx Moderators @Qt Enthusiast last edited by raven-worx

        @Qt-Enthusiast
        QTreeView::scrollTo()

        or alternatively (only horizontal scrolling):

        QHeaderView* h = treeView->header();
        treeView->horizontalScrollBar()->setValue( h->sectionViewportPosition(1) );
        

        --- 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 Reply Quote 2
        • raven-worx
          raven-worx Moderators @Qt Enthusiast last edited by raven-worx

          @Qt-Enthusiast
          QTreeView::scrollTo()

          or alternatively (only horizontal scrolling):

          QHeaderView* h = treeView->header();
          treeView->horizontalScrollBar()->setValue( h->sectionViewportPosition(1) );
          

          --- 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 Reply Quote 2
          • First post
            Last post