title: expand Widget in pyqt
body: <p>I am trying to force my <code>QTextEdit</code> widget to span the whole cell of the <code>QGridLayout</code>.
  I tried a lot of different combinations of <code>QSizePolicy</code> and <code>sizeHint()</code>, but nothing has the desired effect.</p>
  
  <p>In the example below I have a main widget of minimum size 800x600 and another widget 'blue' of size 100x100 in column 1. So I want the <code>QTextEdit</code> in column 0 to be 700x600.</p>
  
  <p>In general I want 'edit' to be (n-<code>blue.width()</code>)xm if my main widget is resized to nxm.</p>
  
  <pre><code>import sys
  from PyQt5 import QtWidgets, QtCore
  
  if __name__ == '__main__':
      qApp = QtWidgets.QApplication(sys.argv)
  
      mainWidget = QtWidgets.QWidget()
      mainWidget.setMinimumSize(800, 600)
      mainLayout = QtWidgets.QGridLayout(mainWidget)
  
      blue = QtWidgets.QWidget(mainWidget)
      blue.setStyleSheet('background-color: blue')
      blue.setFixedSize(100, 100)
      edit = QtWidgets.QTextEdit(mainWidget)
  
      ### what to do here?
      policy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding,
                                     QtWidgets.QSizePolicy.Expanding)
      edit.setSizePolicy(policy)
      ###
  
      mainLayout.addWidget(edit, 0, 0, 1, 1, QtCore.Qt.AlignCenter)
      mainLayout.addWidget(blue, 0, 1, 1, 1, QtCore.Qt.AlignCenter)
      mainLayout.setColumnStretch(0, 1)
      mainLayout.setColumnStretch(1, 0)
  
      mainWidget.setLayout(mainLayout)
      mainWidget.show()
      sys.exit(qApp.exec_())
  </code></pre>