TableWidget border, Hearder Size Fixed, etc...
-
- If you look at number 1 of the capture picture, I want to set the outer boarder of the tableWidget, what can I do?
- I'd like to change the background color of location number 2, what can I do?
- I want to fix the size of the header in position three, and I don't want it to move with the mouse.
- I don't want you to choose location four.
- I want the whole row clicked.
Five questions. Too many questions.ㅜㅜ
I'll say thank you in advance! -
Hi
- 1:
It seems you just painted the border another color and set it size hence the gaps.
From a plain TableWidget i don't get so huge gaps so check your stylesheet
Normally the Table don't have any huge border so I think you set the border size yourself
in the stylesheet to bigger than normally.
No border ?2:
QTableWidget{ background-color: rgb(255, 170, 0); } also colors that area for me ?
-
3:
I think you can either allow dragging for all columns or none.
You could make a custom header and check if you can disallow it from being dragged,
say with mousePress function and check which section its over. -
4:
Well each item can be set if can be selected/edited etc but not seen for sections
https://stackoverflow.com/questions/5421947/disable-selecting-row-or-column-by-clicking-the-header-in-qtablewidget -
5:
table->setSelectionBehavior(QAbstractItemView::SelectRows);
If you mean JUST for that row, all else is selected by cells, then you have to hand code it
so when clicking in any of the cells in the magic row, you slot select all other cell in same rw as the item clicked.
- 1: