PDA

View Full Version : QHeaderView resize problems...



alexandernst
6th August 2009, 20:09
I have some rows and 3 columns.

Some rows have a picture in the first columns, and some doesn't have one.
I'm trying to make the header resize itself to fit the content of the row, so, reading the docs, the most logical option is


header.resizeSections(3)

But this way the items that have a picture in the first column are somehow resized so the picture isn't visible.

How can I fix that?

btw, I'm adding the pictures with DecorativeRole. And every column in each row is a QStandardItem.

Thanks

alexandernst
7th August 2009, 17:58
I'll remake my question :/

Is possible to hide column 0 of each parent and show it on each child?
Something like "if item.hasChildren() = False: item.showColumn(0) ; else item.hideColumn(0)"

Or maybe... Set the resizeMode to fill the contents on the first column, but fit the available sapce on the other columns?