Padding inside Layoutmanagers
Added by Maximilian Kleinert about 5 years ago
Hey,
I want to align a WTextArea with a WLineEdit and WPushButtons below. Something like this:
+------------------------------+
| |
| |
| TextArea |
| |
| |
+------------------------------+
| LineEdit |Button1|Button2|
+------------------------------+
And I want that the size of the WTextArea determines the size of the WLineEdit. I manged to do so by putting this into a WHBoxLayout and a WVBoxLayout each with an empty stretching WContainerWidget. It works, but the padding for innerbox is somewhere overridden by 9px. How can I avoid this?
Best regards
Max
test.cpp (3.12 KB) test.cpp | |||
Padding.png (58.7 KB) Padding.png |
Replies (2)
RE: Padding inside Layoutmanagers - Added by Roel Standaert about 5 years ago
Yeah, there's a default of 9px. You can change it with setContentsMargins: https://www.webtoolkit.eu/wt/doc/reference/html/classWt_1_1WLayout.html#af18bae8c743c9f9a5cabee58826ffb45.
RE: Padding inside Layoutmanagers - Added by Maximilian Kleinert about 5 years ago
It works great. Thank you for the quick reply.
BR
Max