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. How to disable auto scroll for horizontal bar
Forum Updated to NodeBB v4.3 + New Features

How to disable auto scroll for horizontal bar

Scheduled Pinned Locked Moved Solved General and Desktop
7 Posts 2 Posters 782 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
    summit
    wrote on 28 Jun 2020, 08:04 last edited by summit
    #1

    I have a tree view where i want to enable auto scroll for vertical scroll bar but want that feature to be disabled for horizontal scroll bar.

    i could only find autoscroll option for this but it enables and disables both the scroll bars simultaneously.

    Tree view is derived from QAbstractItemModel.

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 28 Jun 2020, 12:22 last edited by
      #2

      Hi
      And if you set scrollbar policy to never so its not show then it still scrolls?
      setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);

      1 Reply Last reply
      1
      • S Offline
        S Offline
        summit
        wrote on 28 Jun 2020, 12:47 last edited by
        #3

        @mrjj i want to scroll the horizontal scroll bar but want to disable auto scroll in the horizontal scroll bar.

        M 1 Reply Last reply 28 Jun 2020, 12:54
        0
        • S summit
          28 Jun 2020, 12:47

          @mrjj i want to scroll the horizontal scroll bar but want to disable auto scroll in the horizontal scroll bar.

          M Offline
          M Offline
          mrjj
          Lifetime Qt Champion
          wrote on 28 Jun 2020, 12:54 last edited by
          #4

          @summit
          Hi
          I dont think that is possible as AutoScroll is always for both directions.

          1 Reply Last reply
          1
          • S Offline
            S Offline
            summit
            wrote on 28 Jun 2020, 13:24 last edited by
            #5

            @mrjj Thanks i will drop this idea and look into my treemodel and treeview to check why the horizontal scroll bar is not showing up , i had given the width to the coloumn treeView->setColumnWidth(0, 1000); to make a scroll bar appear.

            M 1 Reply Last reply 28 Jun 2020, 13:28
            1
            • S summit
              28 Jun 2020, 13:24

              @mrjj Thanks i will drop this idea and look into my treemodel and treeview to check why the horizontal scroll bar is not showing up , i had given the width to the coloumn treeView->setColumnWidth(0, 1000); to make a scroll bar appear.

              M Offline
              M Offline
              mrjj
              Lifetime Qt Champion
              wrote on 28 Jun 2020, 13:28 last edited by
              #6

              @summit
              Hi
              Did you try with
              Tree->header()->setStretchLastSection(true);

              S 1 Reply Last reply 28 Jun 2020, 13:35
              0
              • M mrjj
                28 Jun 2020, 13:28

                @summit
                Hi
                Did you try with
                Tree->header()->setStretchLastSection(true);

                S Offline
                S Offline
                summit
                wrote on 28 Jun 2020, 13:35 last edited by
                #7

                @mrjj said in How to disable auto scroll for horizontal bar:

                Tree->header()->setStretchLastSection(true);

                @mrjj yes i did try but it does not help.

                1 Reply Last reply
                0

                1/7

                28 Jun 2020, 08:04

                • Login

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