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 802 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 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
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on 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 last edited by
        #3

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

        mrjjM 1 Reply Last reply
        0
        • S summit

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

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on 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 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.

            mrjjM 1 Reply Last reply
            1
            • S summit

              @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.

              mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on last edited by
              #6

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

              S 1 Reply Last reply
              0
              • mrjjM mrjj

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

                S Offline
                S Offline
                summit
                wrote on 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

                • Login

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