[Solved] Setting size of QTableView Header
Hi,
I have created a QTableView with QStandardItemModel. I have set the header as follows:
- QString headerlist ;
- headerlist << c1 << c12<< c123;
- mytable->setHorizontalHeaderLabels(headerlist);
I want to set my header size on the basis of size of string in headerlist. E.g. here size of col1 is 2 , col2 is 3 …and so on….
Please suggest a way to do it. I see resizeSection() as one of the solutions. Is there any other way ?
Thanks
2 replies
You must log in to post a reply. Not a member yet? Register here!
