Try "const QString &" instead of QString.
Try "const QString &" instead of QString.
kiker99 (5th May 2006)
thanks for the fast reply, but this doesn't change anything hereOriginally Posted by wysota
![]()
Is this supposed to help or are you guessing?
'const QString&' should help.
my original posting was incorrect
Last edited by shad; 4th May 2006 at 22:17.
code looks like this now.Originally Posted by shad
Qt Code:
// messagepipe.h friend void operator<<(MessagePipe *pipe, const QString& string); // messagepipe.cpp void operator<<(MessagePipe *pipe, const QString& string) { pipe->message(string); }To copy to clipboard, switch view to plain text mode
the error is still exactly the same.![]()
I even recompiled the project, but that didn't help either.
Make the pointer a reference and it should work. You could also return the pipe to allow chaining.
Qt Code:
// messagepipe.h friend MessagePipe& operator<<(MessagePipe &pipe, const QString& string); // messagepipe.cpp MessagePipe& operator<<(MessagePipe &pipe, const QString& string) { pipe.message(string); return pipe; }To copy to clipboard, switch view to plain text mode
kiker99 (5th May 2006)
yihaa, thx a lot @orb9. I had to change everything for references, but now it is working![]()
to tired to think about the reason for this...
Bookmarks