View Full Version : member

25th July 2006, 11:17
hi, I need 2 members similar:

void ob::Write(QTextStream& xstrm)
void ob::Write(QTextStream& xstrm, QProgressDialog*)

but it contain 100 lines. Do I have to repeat the entire body of member twice? another way? thanks

25th July 2006, 11:54
You can use the default value and implement only one of the methods:

void ob::Write(QTextStream& xstrm, QProgressDialog *pd=0){
// no second parameter, act accordingly

28th July 2006, 19:37
Either that, or you can place the code common to both functions in a third (private) function and call it from both. Personally, I prefer it that way.