Passing a non-const reference parameter suggests that you want the receiving function to be able to modify the value and that the modification will affect the passed parameter value. Of course, this is something you cannot do when working with signals and slots across threads. Behind the scenes, parameters, a QString in this case, will be serialized and delivered in a custom event across thread boundaries. Thus, making it non-const reference does not make sense.
Thanks to the fact that QTcpSocket works asynchronously I'm in serious doubt that you even need an external thread to handle data flow.






Reply With Quote
Bookmarks