The two functions QTableViewPrivate::heightHintForIndex() and QTableViewPrivate::widthHintForIndex() do not take the span into account which lead to a too big cell when auto-resizing a row or column. See attached testcase. To reproduce it, try to automatically resize the second column with the mouse (double click on the space between second and third vertical header item). Same can be observed for rows.
The original bug report can be found here: https://forum.qt.io/topic/121148/qtableview-using-setspan-doesn-t-resize-as-expected