The only way to enable threading demonstrated in qt documentation is through inheriting QThread and then override its run() method.
class MyThread : public QThread
{
public:
void run();
};
void MyThread::run()
{
QTcpSocket socket;
// connect QTcpSocket's signals somewhere meaningful
...
socket.connectToHost(hostName, portNumber);
exec();
}
I wonder if there is any way to use qt thread without ever inheriting from any qt objects?