F
F
ftp272014-10-17 12:23:25
Python
ftp27, 2014-10-17 12:23:25

What is the correct way to set the column percentage of a GridLayout in QT?

Good day.
I am writing a kiosk application in PyQT4. I need to place widgets inside a window.
8c85f60dcd0046c281d7fea01688bca1.png
I need to clearly define the ratios of the two columns of the GridLayout (The one in green in the image).
Solved this by setting the first column to:
grid.setColumnStretch(1,1)
Obviously, this is far from the result I wanted, but it looked good on the surface until I set the long text to the second column in the header. Then the right column stretched beyond the screen borders, which is not acceptable :)
It looks like I met the problem in BoxLyaout in the second column. The vertical Layout should be delimited by approximately the same proportions, for the first time I did the same as with the column
HLayout.setStretchFactor(VLayout,1)
But the solution is temporary, and this is somehow not good. Please explain how to do it right

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question