Unsolved Formatting Object in Form Layout
-
@mzimmers said in Formatting Object in Form Layout:
So, I guess the takeaway is that pretty much everything needs layouts?
Yes, pretty much. The widget depends on its layout to manage the geometry of the children, so if there's none the children float freely. Child layouts (the ones in red) are much more rarely needed, but the widgets have to have them to display properly.
-
Makes sense. With the addition of some spacers, I was able to get the layout a little more to my liking.
So, what's the verdict on my IP selector: should I be using a Frame or a QGroupBox?
-
Use whatever gets you the result you are looking for.
-
Right now, I'm experiencing the same spacing problem with either.
What might I be doing to create that large gap between the Device Name and the IP Assignment Source?
-
Might be a silly question but do you have any empty row ?
-
No.
-
Is it me or does it look like your widget is somehow aligned on the bottom of the grid rather than the center ?
-
Are you referring to the IP Assignment Source widget (the one you can't see)? According to the Property Editor, it's centered.
The amount of space suggests that the grid "thinks" there's another line to go in between "Device Name" and "IP Assignment Source." I don't know whether that's possible, though...
-
What about the actual widget you insert? The small one?
-
@kshegunov same thing: AlignLeft, AlignVCenter.
-
I wonder if it's because you have the label that is currently wrapping. For the sake of testing, can you change the text to one word to see if it changes anything ?
-
Tried it...no change.
-
Since it's a designer created widget, would it be possible to post the source of that widget so we can take a look at it ? I'm running out of ideas.
-
Thanks for looking...
-
Sorry but I have a 404 error for that link.
-
Odd...so do I now. Let's try again with another host:
-
Worked !
But it's requiring IpSource which is rightfully missing
-
Here's ipsource.ui:
-
Making it IpSource a simple QWidget with the two radio buttons in a vertical layout from which your put all margins to 0 seems to do the trick.
-
Yes it does. That's kind of wild.
I'm not quite sure what this says about the QFrame and QGroupBox classes, but I guess the answer is not to use either inside a grid if you care about your spacing.
Anyway, thanks for chasing this down.