Unsolved QtCreator: Make all selected buttons the same size
-
Is there a command within QtCreator's dialog editor to make a selected group of buttons the same size?
I'd also love to be able to space them at even intervals, horizontally.Perhaps I've been spoiled by MS Visual Studio, but this really seems like there should be a very visible command for doing this.
-
Qt uses layouts to obtain that effect. Just select all buttons, right click and layout->layout in a grid
-
@StringTheory
additionally to what @VRonin said, you can select all buttons and than change the Properties on the (default) right hand side of the Designer. The changed value/property will be applied to all selected widgets. -
@VRonin said in QtCreator: Make all selected buttons the same size:
Qt uses layouts to obtain that effect. Just select all buttons, right click and layout->layout in a grid
I'm still learning some of the quirks of Qt Creator, but I thought I had seen a 'make same size' option somewhere. I know that grids usually relate, but in some cases, I'm looking to do this with buttons in various different places within a dialog. IOW, I wouldn't want the positions to be affected, just the sizes.
If you think my answers are wrong, please downvote me
I dare you to say that on StackOverflow! :-) (Seriously, this is a much cooler and more helpful place)
-
@J.Hilk said in QtCreator: Make all selected buttons the same size:
@StringTheory
additionally to what @VRonin said, you can select all buttons and than change the Properties on the (default) right hand side of the Designer. The changed value/property will be applied to all selected widgets.OK, that should work. In Microsoft's Visual Studio, there are options like 'make same size', 'align top edge', 'align bottom edge' etc. I miss those. There are places where I'd like to (for example) align the left sides of disparate object types and sizes.
The various alignments in Qt (grid, etc) are great, but I cringe when I need to 'break' the alignment to add or rearrange, then hope that I can recreate what I had. I should find a specifically targeted tutorial on the subject. I find the Qt interface rather unintuitive at times.
(PS: How do you get a 'reputation point'? The forum only allows replies 10 minutes apart)
-
@StringTheory said in QtCreator: Make all selected buttons the same size:
I wouldn't want the positions to be affected, just the sizes.
You can add spacers to the layout so the widgets don't move
@StringTheory said in QtCreator: Make all selected buttons the same size:
I dare you to say that on StackOverflow!
I piled so many downvotes there I don't even care anymore. It's a dangerous place for people that still use
new
/delete
-
Hi
In the beginning i also missed align functions/ options but it turned out
you use layout most of the times to allow for different resolutions/window sizes so
it actually very rare you have free floating Widgets.And you can actually add / rearrage without breaking layout. but only with dragging.
If u drag a new Widget to layout, a small blue line is shown where to insert.
and you can rearrange same way