I want the QTableWidget vertical scrollbar to the left.

Asked 1 years ago, Updated 1 years ago, 69 views

I would like to display the vertical scroll bar of QTableWidget on the left, is there any way to make it smart? I know you can't do it with built-in.
The reason I want to do that is because there are scenes like this.
I'd like to compare the number of fixed decimal points in the right corner with the number displayed by vertical arrangement of upper and lower widgets (e.g., QLabel) and the size.Due to the length of the QTableWidget list, when the scrollbar disappears or appears, the horizontal position of the number shown in the right column changes, which is very ugly.You can avoid this problem by having a scrollbar on the left.
Also, I have created a UI using QtDesigner.QML is not used.The code is C++ using version 5.9.

qt5 qt-creator

2022-09-30 20:19

1 Answers

The answer is not to display the scrollbar to the left, but
By setting the value of property verticalScrollBarPolicy in QTableWidget (strictly parent class QAbstractScrollArea) to ScrollBarAlwaysOn, I think the scrollbar will appear regardless of the length of the list>


2022-09-30 20:19

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.