Hello,
i'm sure someone had the same problem before. I am trying to make one of my classes able to receive "<<"-Operations. this is my code:
Code:
// messagepipe.h //messagepipe.cpp { //do something }
MessagePipe is my class. This produces an error if used like this:
Code:
MessagePipe *hint; hint << "Hi there.";
--> error: invalid operands of types 'MessagePipe*' and 'const char [10]' to binary 'operator<<'
Hm, he isn't able to get a QString out of "Hi there". This seems to work only if used as a real parameter. Does anybody understand this behaviour? I don't want to write everytime QString("My Text"). Any ideas? Thanks.