PDA

View Full Version : QTcpSocket in QThread



Alex Snet
23rd April 2009, 12:30
How to make QTcpSocket available from all functions in QThread class?

I will add bandwidth to my application. All the operations for socket does in socketThread class.

http://code.google.com/p/mediasrv/source/browse/#svn/trunk/src/srv

lyuts
23rd April 2009, 13:48
Subclass QThread (let it be MyThread) and add a memeber of type QTcpSocket to MyThread class.

Alex Snet
25th April 2009, 18:45
Subclass QThread (let it be MyThread) and add a memeber of type QTcpSocket to MyThread class.


How I can do this?

lyuts
25th April 2009, 19:02
Something like this.




class MyThread : public Thread
{
public:
MyThread(...);

private:
QTcpSocket *mSocket;
};