2 Attachment(s)
Resizable width of vertical Header in QTableWidget
Hello,
I program currently a GUI with PyQt and I've created a QTableWidget where vertical and horizontal headers are visible.
My problem is currently that I can not change the width of the vertical header with the mouse. The width of the other columns can I change already.
Changeable width:
Attachment 12094
Not Changeable width:
Attachment 12095
My question is whether it is possible to make the width of vertical header resizable.
Thanks
Re: Resizable width of vertical Header in QTableWidget
I don't see any vertical header, but maybe you mean the first column/section of the horizontal header?
You could try calling QHeaderView::setSectionResizeMode() for section 0.
Cheers,
_
1 Attachment(s)
Re: Resizable width of vertical Header in QTableWidget
@anda_skoa: the vertical Header is exists (see image) and i use this function already, but it set only the size mode of Sections and not of vertical headers.
Attachment 12096
Re: Resizable width of vertical Header in QTableWidget
You could try setting the size policy of the vertical header view so that it allows shrinking.
Cheers,
_
Re: Resizable width of vertical Header in QTableWidget
i try it but nothing has changed.
Added after 19 minutes:
My Problem is that some vertical header in my QTableWidget have a long names. So as altenative for resizable vertical header i want to set a fixed width fo the Header and make a text elided.
My Question is how can i make a text of a header elided?
Thanks
Re: Resizable width of vertical Header in QTableWidget
Since you wrote QTableWidget, do you set header items for the vertical header?
If setting different size hint does not work, you could try setting elided texts, e.g. using QFontMetrics::elidedText().
Cheers,
_
Re: Resizable width of vertical Header in QTableWidget
Thanks for your help anda_skoa. I use now elided text with fixed header width and it works.