1 Attachment(s)
QTableWidget do not hide headers on resize, what to do?
Hello Qt community!
I have a QTableWidget and I don’t want its headers to resize forever.
I know that I can hide the scrollbar, but this still doesn’t solve my problem.
Let’s say that I have 3 headers in my QTableWidget, named “Oneâ€, “Two†and “Threeâ€. I want to be able to resize each of these headers without the text of the others to be hidden. So, basically I need a minimum ‘resize rate’, which has to be set to the width that the text of each header captures.
Sorry if I am not fully understandable.
Here are an example screenshot of what I don’t want to happen:
Attachment 7888
As you see, I’ve resized “Twoâ€, but the text of “Three†has been hidden, and I’ve turned scrollbars off. I want to be able to resize each header (column) till the point of not hiding the text of the other headers.
Thanks in advance for any help :)
Re: QTableWidget do not hide headers on resize, what to do?
Code:
QHeaderView *header
= yourTableWidget
->horizontalHeader
();
Re: QTableWidget do not hide headers on resize, what to do?
Thanks for the answer but this ones disables the Resizing..
We want to be able to resize columns but if u resize the one before the last one don't continue resizing as much as u want ( see previous screenshot )..
Re: QTableWidget do not hide headers on resize, what to do?
What do you expect to happen when the user resizes the whole window?
Re: QTableWidget do not hide headers on resize, what to do?
What should i expect? Tablewidget becomes bigger, and collumns become bigger..
Why question this.. this has nothing to do with my question ( i think )
Do you understand what i ask?
Re: QTableWidget do not hide headers on resize, what to do?
Quote:
Originally Posted by
Bong.Da.City
Why question this.. this has nothing to do with my question ( i think )
It has a lot to do with your question. Especially the behaviour you want when the window is resized down.
Re: QTableWidget do not hide headers on resize, what to do?
OK Think for now, let's says i have maximum and minimum to window and i can't resize it..
How to do what i say in 1st post?
Re: QTableWidget do not hide headers on resize, what to do?
Then you need to control resizing of the header manually either by reimplementing some virtual methods in QHeaderView subclass or by connecting to QHeaderView::sectionResized() signal (or both).