I'm suffering from this same problem, and I have a single-threaded application.
I invoke QTcpSocket in a separate class as a static object with no parent (attempting to set a parent after it has been instantiated seems to confuse QObject and create free() errors on shutdown). An entirely different class then takes this socket and tries to make it connect to a remote server.
Here's what the connection looks like:
QTcpSocket * mySocket
= &formBasePlugin
::socketServer;
mySocket
->connectToHost
(ui.
lineEditHost->text
(), ui.
spinBoxPort->value
(),
QIODevice::ReadWrite);
QTcpSocket * mySocket = &formBasePlugin::socketServer;
mySocket->connectToHost(ui.lineEditHost->text(), ui.spinBoxPort->value(), QIODevice::ReadWrite);
To copy to clipboard, switch view to plain text mode
Bookmarks