title: PyQt: How to adjust QTableView header-size/column-width
body: <p>I am trying to set the header-size or column-width as described in this <a href="https://stackoverflow.com/questions/8569798/pyqthow-do-i-set-different-header-sizes-for-individual-headers">link</a>.</p>
  
  <p>The problems are:</p>
  
  <ol>
  <li><p><code>table.horizontalHeader().setStretchLastSection(True</code>) is ok but not optimal</p></li>
  <li><pre><code>self.produktKaufTb.setColumnWidth(1, 80)
  self.produktKaufTb.horizontalHeader().setResizeMode(0, QHeaderView.Stretch) 
  </code></pre>
  
  <blockquote>
    <p>returns "AttributeError: 'QHeaderView' object has no attribute'setResizeMode'"</p>
  </blockquote></li>
  <li><p>the other both options</p>
  
  <pre><code>.horizontalHeader().setSectionResizeMode(1) 
  </code></pre>
  
  <p>or</p>
  
  <pre><code>.horizontalHeader().setSectionResizeMode(QHeaderView.Stretch) 
  </code></pre>
  
  <p>doesn't allow to resize the column with the mouse</p></li>
  </ol>
  
  <p>How I can set the column-width in PyQt5?</p>