Solved How to disable auto scroll for horizontal bar
-
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.
-
Hi
And if you set scrollbar policy to never so its not show then it still scrolls?
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); -
@mrjj i want to scroll the horizontal scroll bar but want to disable auto scroll in the horizontal scroll bar.
-
@summit
Hi
I dont think that is possible as AutoScroll is always for both directions. -
@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.
-
@summit
Hi
Did you try with
Tree->header()->setStretchLastSection(true); -
@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.