I am using Qt 5.5.0 for Windows. In a dialog using for login as well as register, I use a QVBoxLayout as the main layout of the dialog and add a QGridLayout to the mainLayout. W
You are removing just from layout, not the parent widget, so they are shown in the widget not "layouted".
Try simply hiding them with setVisible(false), and setVisible(true) to show them again.
void LoginDialog::showRegister()
{
...
useremailLabel->setVisible(true);
...
}
void LoginDialog::hideRegister()
{
...
useremailLabel->setVisible(false);
...
}