PDA

View Full Version : QTableView resizing to contents.



chris_helloworld
24th November 2010, 11:12
Hi All,

I'm calling resizeColumnsToContents() on a QTableView after having made changes to my model, eg, inserting rows etc., however am not seeing the resize working properly.

I'm wondering - does the QTableView update itself in background when the model changes and am I calling the the resize too quickly ? It does work ok if I put a delay in before the resize.

Cheers,
Chris.

koan
24th November 2010, 12:59
It works fine on QTableWidget. I find that these functions don't give the result I really want: a nicely spaced table filling the available space. I tend to have to calculate the size of the table and do all the sizing myself.

chris_helloworld
24th November 2010, 13:43
Cheers. Actually, I'm thinking now its a problem somewhere in my code. I do similar things in other places which are working ok.