4

How to change scrollbar position from next to header

enter image description here

to below header?

enter image description here

Any ideas how to implement this are appreciated.

noee
  • 41
  • 5

2 Answers2

0

You can try below hack:

  1. Put the QTableView in a QVBoxLayout
  2. Get horizontal header view from QTableView using horizontalHeader()
  3. Insert the horizontal header view in the QVBoxLayout on top of QTableView
Sajal
  • 1,783
  • 1
  • 17
  • 21
0

You can do this in qss (I assume your header has 50px height with a blue color) :

QScrollBar::sub-line:vertical {
    padding-top: 50px;
    height: 20px;
    background-color: blue;
}
QScrollBar::vertical {
    margin-top: 50px;
    padding-top: 20px;
}
Theo
  • 13
  • 5