PDA

View Full Version : QString and Threads



probine
3rd January 2007, 22:32
SOLUTION:

message is the variable, but also the name of the class. So, change the name of the variable


I have a class that allows me to do



message->parseMessage("hello");


From another thread I call a function in the first thread, I also pass a QString to that function.



void Client::readThreadMessage(QString message){
message->parseMessage(message);
}


For some reason I get this compiler error:

client.cpp: In member function `void Client::readThreadMessage(QString)':
client.cpp:127: error: base operand of `->' has non-pointer type `QString'
make[1]: *** [release\client.o] Error 1

What is wrong ? Why I cannot just use the QString that came from the other thread ?

jacek
3rd January 2007, 22:35
What is wrong ?
"message" is not a pointer, but QString --- the one you pass as an argument. Change its name and it should work.