Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to removing remaining spacing after hide a row in QFormLayout

Tags:

layout

qt

Hide a row by the following code

field.hide()
formLayout.labelForField(field).hide()

One disadvantage of the above is that while the items in the row are hidden the spacing above and below the row remains, that is, the rows above and below the hidden row appear further spread apart than the rest of the items in the layout. How to removing remaining spacing after hide a row in QFormLayout?

like image 407
user1899020 Avatar asked Aug 01 '13 05:08

user1899020


1 Answers

Hide:

field->hide();
label->hide();
formLayout->removeWidget(field);
formLayout->removeWidget(label);

Show:

formLayout->insertRow(row, label, field);
label->show();
field->show();
like image 112
Anatoli Avatar answered Nov 08 '22 03:11

Anatoli