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();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With