[Qt-interest] size of QCheckBox

Colin S. Miller no-spam-thank-you at csmiller.demon.co.uk
Tue Sep 15 11:17:53 CEST 2009


Serge wrote:
> Hello,
> 
> i have list of frames.
> each frame contains grid layout with widgets.
> first column in grid - checkboxes with empty text label.
> 
> some frames must not contain checkboxes. just empty space.
> if all cells in column are empty, grid layout makes it very narrow. But 
> i need so that width of layout column without checkboxes would be the 
> same as width of column with checkboxes.
> 
> How to make it?
> I tried to make empty frames but they have not same size as checkbox?
> How to make empty frame/widget with same size as QCheckBox?
> If make temporary QCheckBox, get it size, and make frames using this 
> size, it is incorrect.

Serge,
QGridLayout::setRowSpace(int row, int minSize)
will set the minimum width of a row in a QGridLayout.

If you set this to the width of a QCheckBox that doesn't have text,
then this should work.

HTH,
Colin S. Miller




More information about the Qt-interest-old mailing list