Unsolved Automatic resizing problem
-
@SGaist
Hello,This is what I do:
I don't know why it is not displayed, but after adding the buttons, I right click on the main window, and in "layout", I choose "place horizontally".
At the end, on the image, the window is not also displayed, but it is launched. I resize it, but the buttons don't.
-
What do you get if you put just the buttons on the widget and then call layout horizontally using the contextual menu has explained here ?
-
@SGaist
Hello,
It is the same result. In Qtdesigner, resizing works.
Once run, no.
-
Additional info,
When I use pyside2 without qt creator it seems to work.
I tested the following code:
https://doc.qt.io/qtforpython/quickstart.html -
@moas
Then I would compare the code which ends up being generated from Designer (viapyuic
) into the.py
file against the example which works, see what it is that is different, and work back from there? -
Here are the 2 files:
On the left, the .QUI converts
The only differences are highlighted in red. -
@moas These two code snippets do not match at all. On the left side you have two buttons in a horizontal layout. On the right side you have a button and a label in a vertical layout.
-
Normal, in one is the code snippet of the link, in the other it's just a test on my part. I did not see the point of making the same layout as on the link, because to compare, I think that is enough.
Besides, I do not see any real difference once the same layout.
-
On the other hand, I don't know if there is a link, but I don't see self.setLayout (self.verticalLayout)
-
If you are talking about the UI_test code, that's because
self.verticalLayout
is created with at parent. When you give a layout a parent at construction time it's directly applied to it.