There is some inconsistency in your posting:

Quote Originally Posted by Vladimir_ View Post
I wanted to do an action when an incoming connection to the server is established from a client.
This sounds like you are writing server code.

Quote Originally Posted by Vladimir_ View Post
while "socket" is is a pointer to QTcpSocket :
Qt Code:
  1. socket = new QTcpSocket;
To copy to clipboard, switch view to plain text mode 
while this is clearly client code.

For a client the connect should work, i.e. the slot should be invoked when the socket establishes a connection to the server.
For a server, the client is already connected (it has connected to the server after all), so the socket is already in "connection established" state.

Cheers,
_