PDA

View Full Version : Qt widget ratio



vhptt
2nd August 2012, 02:56
I create a pushButton and a lineEdit, then put them into a horizontalLayout.
Is there a way to set pushButton.width() : lineEdit.width() = 1 : 7 ??? (without hard pixel for each)

ChrisW67
2nd August 2012, 06:30
Yes, use the second argument to your addWidget() calls. See the [doc=/layout.html#stretch-factors]Layout Management[/docs] for more on stretch factors.