title: QTcpSocket - Check if is connected
body: <p>Trying to connect:  </p>
  
  <pre><code>QTcpSocket *tcpClient = new QTcpSocket(this);
  tcpClient-&gt;connectToHost(ip_address, portNumber);   
  </code></pre>
  
  <p>But <code>connectToHost</code> returns void.<br>
  So what should I do to check up if <code>tcpClient</code> is connected to the given address and port ?<br>
   How can I give this connection attempt an allowed timeout and check connection state when timeout expires ?</p>