Formatting Object in Form Layout
-
@mzimmers said in Formatting Object in Form Layout:
I assume you're talking about the top-level widget.
No, I'm talking about the small widget you're inserting into the top-level widget.
But the consideration applies to the top level widget as well, if it doesn't have a layout, give it one. -
Trying to consolidate kshugunov's suggestion with SGaist's...I created a QFrame, QVBoxLayout, and two QRadioButtons. Oddly enough, when I don't use a form layout on my details, the information shows up (though it's not yet formatted as I'd like):
But when I do a form layout on the stuff on the left, The frame shrinks and the buttons disappear:
Do I need some explicit geometry on the frame to prevent it from getting shrunk?
-
@mzimmers said in Formatting Object in Form Layout:
Do I need some explicit geometry on the frame to prevent it from getting shrunk?
Mind uploading the .ui file somewhere so I can open it with the designer?
-
Thanks...
-
Thanks for taking the time to do that, kshegunov. So, I guess the takeaway is that pretty much everything needs layouts? I'd been limiting my use of them to where I could see they were needed, but if failing to use them results in stuff (like my radio buttons) not showing up, then I guess they're needed in more places than are immediately evident.
-
@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.
-
Use whatever gets you the result you are looking for.
-
Might be a silly question but do you have any empty row ?
-
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...
-
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 ?
-
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.