Automatic resizing problem
-
Hello,
Je suis nouveau sur QT et j'essaie de tout redimensionner avec la fenêtre (avec Qt Designer).
I have set up the various elements in a layout, and when I resize directly with QTDesigner, it works.
However, when I run the application, the elements do not resize.
Additional Info
Did I forget something?
Thank -
Hi and welcome to devnet,
One strange thing I see is that you have your two horizontal layouts beside each other. AFAIK, it's not something that should be possible. You can have only one layout applied on a widget. That layout however can contain other layouts like horizontalLayout_2 does.
-
In the first image, you have no layout and in the second it looks like the layout was bit applied to the widget (I might be wrong though), how are you handling the layouts exactly ?
-
@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.
-
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 -
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.
-
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.