I know this is more of a programming question that a Qt question, but I'm stumped as to how I would implement a dialog (with its own class) that gets, say, two or so text responses from the author, and returns them. My last unsuccessful try was to pass pointers to two QString's to the CustomDialog class's initialization, but I can't figure out how to set the text of those two variables to the text from the two line edits in the popup dialog. Here's what I have so far:

Qt Code:
  1. //szName and szDescription are the two inputs that I want to get from the user
  2. //This class is initialized from another source file, which passes pointers to two QString's
  3. DialogAskQuestions::DialogAskQuestions(QMainWindow* parent, QString* szName, QString* szDescription)
  4. {
  5. setupUi(this);
  6.  
  7. parentWindow = parent;
  8. targetName = szName;
  9. targetDescription = szDescription;
  10.  
  11. connect(btnOK, SIGNAL(clicked()), this, SLOT(answerAccepted()));
  12. }
  13.  
  14. void DialogAskQuestions::answerAccepted() {
  15. targetName = edtName->text();
  16. targetDescription = edtDescription->text();
  17. }
To copy to clipboard, switch view to plain text mode 

Am I going about this the wrong way? How do best I return information (i.e., two QString's) to the class' caller?

Thank you!