What does your func() function? As said in the last answer you have to call exec, in your case
void MainWindow::on_pushButton_clicked()
{
Dname = new name();
name1->func(); // ? that won't compile...
Dname->exec(); // <- new
ui->label->setText(Dname->getCname()); // Here I am getting the problem (returning null string)
}
void MainWindow::on_pushButton_clicked()
{
Dname = new name();
name1->func(); // ? that won't compile...
Dname->exec(); // <- new
ui->label->setText(Dname->getCname()); // Here I am getting the problem (returning null string)
}
To copy to clipboard, switch view to plain text mode
or call show, but then you have to emit a signal from your dialog and fetch it in a slot of your main window where you then read the value of your line edit.
Bookmarks