@SGaist
The QSizePolicy is set to Expanding, because I want the table should take all the space by default. Anyway I tried to set it to Minimum but nothing changes. It seems something force the minimum size of the table, but I printed out the actual minimumSize value and is set to 0, even after adding the contents.