Hi all,

I need a listview with a visible and a hidden column. The hidden column should never become visible for the user as this is only used for coding issues.

I created a MyListView class derived from QListView with the following code in the constructor
Qt Code:
  1. addColumn("testcolumn");
  2. addColumn("testhiddencolumn", 0);
  3. hideColumn(1);
To copy to clipboard, switch view to plain text mode 

This has the following result: The listview shows two columns, namely the testcolumn and an empty column and the user is not able to view the testhiddencolumn even not when trying to resize the 0-width column.

As I wanted to use as much of the width of my listview, I wanted to make the column testcolumn use all the space in the listview, so I included the following line of code to the above constructor:

Qt Code:
  1. header()->setStretchEnabled(true,0);
To copy to clipboard, switch view to plain text mode 

This resulted in the testcolumn taking the entire width of the listview, but i got a strange site effect: When I dragged the column testcolumn-end in order to make the column smaller, the hidden column appeared and got larger. (it would be easy if I could show the result with some pictures, but don't know how to do that, they are not online...)

How can I prevent the hidden column from showing after using setStretchEnabled? I need to allow resizing of column testcolumn as I want to keep the size of this column synchronised to its contents.

I Tryed adding:
header()->setStretchEnabled(false, 1);
and/or:
header()->setResizeEnabled(false,1);
but none of both did the job.

Any ideas?