I got the widgets to display. When I originally created the dialog in the designer, the dialog was was named by Object

as Dialog. But no dialog.h was created. So I used uic in the Qt bin folder to create it. In the resulting dialog.h the

class is called Ui_Dialog, with a namespace declaration at the bottom of it called Ui, specifying the Dialog class.

So in my class .cpp that's calling the dialog, I added:

using namespace Ui;

Then in my class calling procedure I used the following code:
Qt Code:
  1. Ui::Dialog ui_d1;
  2. Dialog D1;
  3. ui_d1.setupUi(&D1);
  4.  
  5. if(D1.exec() == QDialog::Accepted)
  6. {
  7.  
  8. Temp1 = D1.lineEdit->text();
  9.  
  10. // Some following code
  11.  
  12. }
To copy to clipboard, switch view to plain text mode 
But now the program crashes when using the text() function to return the text of the lineEdit. Temp1 is a QString

declared variable and the program runs when I use a valid value of "2", commenting out the lineEdit->text() line.

Any ideas what could be causing that?