Designer an central widget layout
-
I have a widget that is promoted to MyCanvas and some buttons. I want all the object to resize when I resize the MainWindow. I know that need a horizontal layout for the button and a vertical layout for the button layout and the promoted widget. I follow the instructions in the Qt documentation, but nothing works. I know that I have this problem in the past and I was missing a step. What am I missing?
-
Please post your code.
-
Please post your code.
@Axel-Spoerl There is no code as it is done in Designer.
I deleted all objects so only MainWindow and its child centralWidget remain. Then I added a Widget, with AutoBackgroundFilled checked and select VerticalLayout. That resizes. Now I am stuck as everything I add does not resize. -
Please post the ui file and the code you run it with.
-
I feel like a real idiot. The last time I created a program that had resizing was over two years ago and I had forgotten two very important point: First for my desired UI add pushbuttons and spacers, put then in a horizontal layout, then add the Widget and select the MainWindow and add vertical layout, and Second ignore the UI shown, try it to see if you like it. I executed it and it was what I wanted. My mistake was that I looked at the documentation and the Web for help and they always started with adding a widget, usually a pushbutton. I did that and I dug myself into a hole from which I could not extricate myself. There must be a warning what you see in Designer, execute it as that is the real test. Sorry to have wasted everyone's time.