So, with
tableWibget->horizontalHeader()->setResizeMode(QHeaderView::ResizeToContents);
my column are resized to content, but that doesn't look good when content is small and grid doesn't fit all the space.
and with
tableWibget->horizontalHeader()->setResizeMode(QHeaderView::Stretch);
it fits all the space, but sometimes content of some cell doesn't shown fully.
how can I make something like both above - content must fit all the place in widget, but if some cell can't take all content it resize to fit it all and scroll bar appears
You can set resize mode on column index as below::
headerView->SetResizeMode(0, QHeaderview::Stretch);
headerView->SetResizeMode(1,QHeaderview::Interactive);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With