Exactly that: override incomingConnection
but don't call the base class, instead create an instance of your QTcpSocket
subclass and use setSocketDescriptor
on it. If you want to keep QTcpSocket "signal behaviour", also call addPendingConnection
and emit newConnection
.
Then just downcast the socket you get from nextPendingConnection
to your QTcpSocket subclass.