First I would like to say; I'm new to Qt, so this may be a simple question.

I'm trying to make a simple tcp server/client application, where the client can send a string to the server. My problem is that I want a list of connected clients, and if a client disconnect it should be remove from the list.

Any ideas on how to do that?

I tried the following:
The function to remove the client from the list
Qt Code:
  1. void Server::removeClient(QString address)
  2. {
  3. for(int i = 0; i < clientList.size(); i++)
  4. {
  5. if(strcmp(clientList.at(i).toAscii(), address.toAscii()) == 0)
  6. {
  7. clientList.removeAt(i);
  8. }
  9. }
  10. }
To copy to clipboard, switch view to plain text mode 

The signal-slot thing
Qt Code:
  1. connect(client, SIGNAL(disconnected()),
  2. this, SLOT(removeClient(const QString &)));
To copy to clipboard, switch view to plain text mode 

I don't know if I did it right since I'm new to the whole Qt thing. But I get this error:
Object::connect: No such slot Server::removeClient(QString &)