简体   繁体   中英

How to removing remaining spacing after hide a row in QFormLayout

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?

Hide:

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

Show:

formLayout->insertRow(row, label, field);
label->show();
field->show();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM