Important: Please read the Qt Code of Conduct -

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?

  • Lifetime Qt Champion

    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.

  • @SGaist


    I couldn't answer before. I did some tests with what you explained to me, but nothing changes.


  • Lifetime Qt Champion

    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

    This is what I do:
    form.ui @ main - Qt Creator 2020-11-27 17-56-32.gif

    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.

  • Lifetime Qt Champion

    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 ?

Log in to reply