The dockwidgets will be incorporated into the layout of the main window, so any attempt to resize them will be ignored.
The standard workaround for this is to create a subclass of the content widget and reimplement its sizeHint
:
class TreeWidget(QtGui.QTreeWidget):
def sizeHint(self):
return QtCore.QSize(150, 75)
mw.dockWdg2 = QtGui.QDockWidget(mw)
mw.content2 = TreeWidget()
mw.dockWdg2.setWidget(mw.content2)
However, this will only work to the extent that you also carefully manage the sizes of the other dockwidgets. And of course maximiizing the main window is also going to have a impact on the final outcome.
You might also want to consider using QMainWindow.saveState and QMainWindow.restoreState to manage the initial state of your dockwidgets.