2

I am writing an application for kiosk PyQt4. I need to place widgets inside the window.

application mockup

I need to clearly define the ratio of the two columns of QGridLayout (It is green in the image). It's decided by setting the first column in:

grid.setColumnStretch(1,1)

Obviously, it is far from my desired result. But the appearance it's looked fine, until I installed a long text in the second column in header. Then the right-hand column stretched beyond the screen. it is not permissible :)

I met a similar problem in box layout in the second column. Vertical layout should be differentiated roughly the same proportions. For the first time, I did the same thing as I did with the column

HLayout.setStretchFactor(VLayout,1)

But it's a temporary solution, and I think it's not right. Please anybody explain me how I can do this correctly

Iuliu
  • 4,001
  • 19
  • 31
ftp27
  • 885
  • 1
  • 12
  • 31
  • 1
    Have your first left label widget being the minimum size set to layout->widget->width() / 4 and the overall width to your desired maximum width (e.g. screen width). The right side should be set to MinimumExpanding to always take up whole accessible space. If you are using fixed size font for your labels, think about a reasonable maximum static (not calculated) size for the left column. – Sebastian Lange Oct 20 '14 at 08:45

0 Answers0