PDA

View Full Version : How should I return data (string, int) after a QDialog is close?



ricardo
27th June 2009, 20:03
Hi!

How should I return data (string, int) after a QDialog is close?

Is this correct?


CNewLevelDialog dialog2(this);
QString string; int number;
if (dialog2.exec()==QDialog::Accepted) {
string= dialog2->getstring();
number= string= dialog2->getnumbre();
}

Thanks!

lni
27th June 2009, 20:14
Hi!

How should I return data (string, int) after a QDialog is close?

Is this correct?

CNewLevelDialog dialog2(this);
QString string; int number;
if (dialog2.exec()==QDialog::Accepted) {
string= dialog2->getstring();
number= string= dialog2->getnumbre();
}

Thanks!

dialog2 is not a pointer, use
string= dialog2.getstring();

ricardo
27th June 2009, 20:26
dialog2 is not a pointer, use
string= dialog2.getstring();

OK, that's true, a tiny mistake. Thanks.