[Qt-interest] Setting all columns of a QHBoxLayout to have the same width
Brad Howes
howes at ll.mit.edu
Thu Aug 12 18:48:38 CEST 2010
On Aug 12, 2010, at 12:35 PM, Felipe Sodré Silva wrote:
> Hi. Sorry, but I kinda new to Qt, and my biggest problem here is how to get the maxWidth value. If I have, say, a QRadioButton, how can I know its width within a QGridLayout, for example? I've tried minimunWidth() but it always returns zero to me.
When are you calling it? I vaguely remember some dance widgets go through with their layouts (and parent layouts) before some values have any meaning. But I have not had to muck with this stuff in ages. I would assume that implementing your own QLayout class and implementing/overriding the appropriate methods would be sufficient to avoid having to know the dance moves. You may have to look at the source to, say, QHBoxLayout and see what it is doing and mirror it except in the place where you report to others your preferred and minimum horizontal size.
Brad
--
Brad Howes
Group 42
MIT Lincoln Laboratory • 244 Wood St. • Lexington, MA 02173
Phone: 781.981.5292 • Fax: 781.981.3495 • Secretary: 781.981.7420
More information about the Qt-interest-old
mailing list