I have created a modal dialog and it responds to the 'ok' and 'cancel' buttons fine. My main issue is that when I attempt to put code to access the other fields in the dialog I get some errors:

Qt Code:
  1. //popup for modal dialog:
  2. void PulseMain::popupmodal() {
  3.  
  4. //create a dialog box:
  5. DialogLogin dlg(this);
  6.  
  7.  
  8. //do something once we click OK:
  9. if( dlg.exec() == QDialog::Accepted ) {
  10.  
  11. //initialize a place to put our login information:
  12. var_login login;
  13.  
  14. // Extract the information from the dialog
  15. login.username = dlg.userid->text();
  16. login.password = dlg.password->text();
  17.  
  18.  
  19.  
  20. QMessageBox::warning( this, "Dialog results!", "We clicked OK!");
  21.  
  22. //else do something when we click cancel:
  23. } else {
  24.  
  25. QMessageBox::warning( this, "Dialog results!", "We canceled it!");
  26.  
  27. }
  28.  
  29.  
  30.  
  31.  
  32. //dlg.exec();
  33.  
  34. }
To copy to clipboard, switch view to plain text mode 

everything works fine when the following lines are removed:

Qt Code:
  1. login.username = dlg.userid->text();
  2. login.password = dlg.password->text();
To copy to clipboard, switch view to plain text mode 

when the lines are there I get the following error message when compiling the program:

ui_dialog_login.h:29: error: 'QLineEdit* Ui_DialogLogin::userid' is inaccessible
calculatorform.cpp:48: error: within this context
ui_dialog_login.h:30: error: 'QLineEdit* Ui_DialogLogin:assword' is inaccessible
calculatorform.cpp:49: error: within this context
so it seems that I am using the wrong route to access the text items in the dialog. I am sure that its something simple that I am missing that would make this work properly. Anyone have an idea?