Hello,
How can I make, in a QTableWidget, the first column always visible (Not moved by the scroll bar).
Michel
Hello,
How can I make, in a QTableWidget, the first column always visible (Not moved by the scroll bar).
Michel
Are you trying to make something in addition to the vertical header stationary? I don't know of any way freeze the first column, but I would think that most of the time just having a header for the rows would be good enough - using setVerticalHeaderLabels/Items....
No, what I would like is, if I move the horizontal scroll bar, the first column will always be visible at the left of the widget.
Michel
So are you trying to have two vertical headers? I don't want to seem stubborn or condescending if you are already using a header, but if you aren't using one, adding a vertical header will give you what you want - something that stays in place even when scrolling.
Someone correct me if I'm wrong, but I think in order to freeze a column in place (other than the header) when scrolling, you might need to dig into the Qt source and make some changes.
I was able to do what I want using two QTableWidgets, side by side. The left widget display the column (one or two) that need to be always visible, and the right widget all the other columns. I connected the signals between the two widgets, so they are in sync. The reason to doing so, is to always show the column that represent the key in a database table. I have something working but I want to know if there is a simpler solution.
Thanks
Michel
Interesting.
We solved the same problem by doing the scrollbars ourselves and then hiding and showing the columns to give the illusion of scrolling. Quite messy again, but we haven't come up with a better solution yet.
This thread seems to be interessting over years
I have exactly the same problem.
How did u connect the signal of one scrollbar to two tablewidgets?
Hi ,
Can you post the code snippet to make the first column always visible.
Thanks...
Hi ,
I am having the same problem.
Can some body post the code snippet to make the first column always visible.
Thanks in advance.
Take a look at the Frozen Column Example from 4.6 (also 4.5.3 and possibly earlier) for a way to "freeze" the first column. It's not too difficult to expand to multiple columns. There are some issues with selections crossing the column boundary and also if the columns can be reordered.
Hi,
I faced the same problem.If I move the horizontal scroll bar, the first column will always be visible at the left of the widget.I don't want to use two table views for this.By using scroll bars how can I solve this ? Can any one help me ?
I Tried with Frozen Column example but, it's not work for me . Is there any other solution for this .
Start by keeping your question to the thread you started
http://www.qtcentre.org/threads/6112...-of-QTableview
Bookmarks