PDA

View Full Version : String value



Gayathri
17th November 2006, 12:33
Hi,
I want to pass a string value to a function and the string passed is to be assigned to a label widget available in the form.

how to declare this function?

This is the code written for function declaration.
void Form3::setValue(QString *a)
{
txtWelcome->setText(&a)
}

wysota
17th November 2006, 12:43
I think it should be:

void Form3::setValue(const QString &a){
txtWelcome->setText(a);
}

sunil.thaha
21st November 2006, 05:44
To add to that,

The question is more C++ specific than Qt. It would help if you go through some C++ books also.