Hello all,

I'm trying to get a test app working where a Main Window Menu is used to call a Dialog. Text is entered into the Dialog and then transferred to the Main Window. Sounds easy






My problem is I don't know how to access the Dialog's lineEdit. I've tried the following, but the compiler gives the error that lineEdit is private.

Qt Code:
  1. // from mainwindow.cpp
  2. void MainWindow::on_actionDialog_1_triggered() // if the menu item triggered.
  3. {
  4. Dialog *mydialog = new Dialog(this);
  5.  
  6. if (mydialog->exec())
  7. {
  8. QString textIn = mydialog->ui->lineEdit->text();
  9.  
  10. ui->textEdit->append(textIn);
  11. }
  12.  
  13. }
To copy to clipboard, switch view to plain text mode 

Here are the files generated by Creator from my Dialog.ui:

ui_dialog.h
dialog.h
dialog.cpp

Thanks.