Hi all... I need some help with type casting or any thing which helps me to solve this problem.
I have a QTcpServer, and I connected the
Qt Code:
  1. newConnection()
To copy to clipboard, switch view to plain text mode 
signal of it to some slot. As you can see in the code below I used QTcpServer::nextPendingConnection() to get the new connection. but this method returns a QTcpSocket, And instead I need a QSslSocket for the rest of my program. Is it any possible way, for example like static_cast or ... to make the QTcpSocket to a QSslSocket ..!? I know that QSslSocket inherits QTcpSocket

Qt Code:
  1. void Server::manageQuery()
  2. {
  3. QTcpServer *myServer = qobject_cast<QTcpServer*>(sender());
  4. QTcpSocket *socket = myServer->nextPendingConnection();
  5.  
  6. connect(socket,SIGNAL(readyRead()),this,SLOT(processQuery()));
  7. connect(socket,SIGNAL(disconnected()),socket,SLOT(deleteLater()));
  8. }
To copy to clipboard, switch view to plain text mode 

I mean some code like this

Qt Code:
  1. void Server::manageQuery()
  2. {
  3. QTcpServer *myServer = qobject_cast<QTcpServer*>(sender());
  4. [SIZE=4] QTcpSocket *socket = (QSslSocket)myServer->nextPendingConnection();[/SIZE]
  5.  
  6. connect(socket,SIGNAL(readyRead()),this,SLOT(processQuery()));
  7. connect(socket,SIGNAL(disconnected()),socket,SLOT(deleteLater()));
  8. }
To copy to clipboard, switch view to plain text mode 

can make the QTcpSocket to QSslSocket? or not