title: Sorting QTableWidget and resizing rows to contents
body: <p>I have tableWidget with 7 columns (1. col - checkable items, 2. col - textEdit widgets, other columns populated with text using qTablewidgetItem).</p>
  
  <p>After the table is populated, in order to be able to sort it when header of any column is clicked, I do this:</p>
  
  <pre><code>tableWidget.setSortingEnabled(1)
  tableWidget.resizeRowsToContents()
  tableWidget.horizontalHeader().sortIndicatorChanged.connect(tableWidget.resizeRowsToContents)
  </code></pre>
  
  <p>My question is: is that the best way to do it?, because when I have over 1000 rows it takes few seconds (up to 5) to sort table when header is clicked. If there is no third line, sorting is done instantly but size of rows get messed up, content cut off or too much white space around content... so, is there faster alternative for line 3?</p>