I would like to use a button_clicked slot to reset all the widgets used in the application. I tried calling the function used in the application constructor, which is present by default when you create an ui application project in Qt.
ui->setup(this)
.
I called the same in the pushbutton_clicked()
slot function. For example -
void MyMainWindow::on_pushButtonLdDefaults_clicked()
{
ui->setupUi(this);
}
This gives me the expected result, all the widgets get reset. But after this, all the buttons and widgets become unresponsive. No events are heard after this.
Am i doing something wrong by calling ui->setup(this)
?
Also, If there is any other way to easily reset the widgets, please share.