You can specify relative width by giving each cell a stretch with setStretch(). They will get sizes proportional to the given stretches. Here is a simple example that makes the right widget 3 times greater than the left widget.
import sys
from PyQt4 import QtGui
if __name__ == "__main__":
app = QtGui.QApplication(sys.argv)
Q = QtGui.QWidget()
H = QtGui.QHBoxLayout()
H.addWidget(QtGui.QTextBrowser())
H.setStretch(0,1)
H.addWidget(QtGui.QTextBrowser())
H.setStretch(1,3)
Q.setLayout(H)
Q.show()
app.exec_()
But, bear in mind that widgets have minimum sizes by default. So they can shrink below that. If you want to change that behavior also, consider setting minimum sizes to your liking.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…