As Lykurg told you you can adjust the size of your widget through QWidget::adjustSize()
or compute the minimum width necessary not to show the horizontal scroll bar, using QWidget::minimumSizeHint () (QTableView inherits QWidget):
MyTableView::minimumSizeHint()
(
compute the minimum width of your tableView in this function
QSize widgetWidth
= theRigthWidth;
return widgetWidth;
)
MyTableView::minimumSizeHint()
(
compute the minimum width of your tableView in this function
QSize widgetWidth = theRigthWidth;
return widgetWidth;
)
To copy to clipboard, switch view to plain text mode
and implement this minimum value in MyTableView::sizeHint()
MyTableView::sizeHint()
{
return minimumSizeHint();
}
MyTableView::sizeHint()
{
return minimumSizeHint();
}
To copy to clipboard, switch view to plain text mode
Bookmarks