how to program custom Dialogs with return values
Hi,
I wonder how to write modal Dialogs executed with QDialog::exec(), that provide a result other than integer values ( which can be easily achieved with QDialog::accept(), QDialog::reject() and QDialog::setResult() ). Since there are Dialogs that return objects like QFonts, QColors etc. all over Qt4, I guess there must be a (simple) mechanism to do that. Any Ideas?
thanx in advance
momesana
Re: how to program custom Dialogs with return values
Quote:
Originally Posted by
momesana
Since there are Dialogs that return objects like QFonts, QColors etc. all over Qt4
Yes, but they either use static methods or signals.
Re: how to program custom Dialogs with return values
Of course you can always do something like this:
Code:
public:
// ...
if(exec())
return myresult();
else return "";
}
private:
QString myresult
() const { return ...
} };
and call it using