Clears and resizes a table widget.

def reset_table_widget(t, rowCount, colCount):
    """Clears and resizes a table widget."""
    t.reset()
    t.horizontalHeader().reset()
    t.clear()
    t.sortItems(-1)
    t.setRowCount(rowCount)
    t.setColumnCount(colCount)