![]() |
"QObject: Cannot create children for a parent that is in a different thread."
Hi all
Having raided the Threaded Fortune Server example, theres a section of code I copied from it that causes this message to print out in the console. I've subclasses thread to create a worker that will read and write the socket, and passed the socket descriptor to the workerthread's constructor. In the workerthread's run method I call: tcpSocket.setSocketDescriptor(theSocketDescriptor) where the int passed in is the socket descriptor, got from the listening socket. This in turn calls trolltech's code: d->socketEngine = QAbstractSocketEngine::createSocketEngine(socketDe scriptor, this); where "this" is the abstract socket itself. I'm thinking that instead of passing the socketDescriptor to the worker and letting it set the socket up itself, I should set the socketDescriptor from the thread that creates the worker? Is this how I get this message to go away? |
All times are GMT. The time now is 14:47. |
vBulletin® Version 3.8.8