c++ - Qt - How to specify and make constant an element size in a layout? -


Say there are QHBoxLayout and some widgets to specify the width of the widget and how to specify the hate in the layout so that the widget can resize , While the layout is given to the given width and the light is constant?

You can use

  zero QWidget :: setFixedSize ( Int w, int h)  

The width of the set w to the widget and the height h. It will fix the size of the fixed widget at the time of resizing the window.

In addition to this, you can use a combination of these functions,

  zero QWidget :: setFixedHyight (Int h)  

And also

  Zero QWidget :: setFixedWidth (int w)  

Whatever is required for your requirement .. Hopefully it will be helpful.


Comments