Tryed that, but it didn't work. The hidden column is imediately (without resizing an adjacent column first) visible then.
I use the function AdjustColumn(0) after renaming an item. Can this have anything to do with it?
Tryed that, but it didn't work. The hidden column is imediately (without resizing an adjacent column first) visible then.
I use the function AdjustColumn(0) after renaming an item. Can this have anything to do with it?
Yes, I'm sure it does. hiding a column, just sets its width to 0. If you hide column 1, then call adjustColumn(0), then the width of column 0 will change to fit its text. If this means that it decreases, then of course the width of 1 will be forced to increase in order to take up the slack. This is true if the resizeMode is LastColumn or AllColumns.Originally Posted by edb
Is it possible to set the resize mode of the last column to be false so that adjustColumn won't have any influence on the last column so that it stays hidden?
The resizemode applies to the whole table. You will have to manage the column widths manually if you need some special behaviour.
Why did you need this hidden column again anyway?
Unfortunately hiding columns in Qt3 QListView is totally screwed up and there are many problems with that...
Is QT4 better for working with hidden columns?
Is there another possibility of keeping information in a Listview for each item which may not be visible to the user, but must only be used in code?
Maybe QMap<QListViewItem*, struct { QString f1, QString f2, ... } > ?Originally Posted by edb
Or:
Qt Code:To copy to clipboard, switch view to plain text mode
I tried the following, 'id' being the section number of the column I want to hide:
Qt Code:
listview->setColumnWidthMode(id,Manual); listview->setColumnWidth(id,0); // preventing the column to show up again when neighbouring columns are resized: listview->header()->setResizeEnabled(false,id);To copy to clipboard, switch view to plain text mode
It seems to do the trick.
Bookmarks