Can someone tell me a good solution how to communicate between client objects? In this case :how can i send a message from a single class of the client object to other Client objects with a message?
Its a server application and here is the code:
Qt Code:
  1. Server::Server(QObject *parent) :
  2. QTcpServer(parent)
  3. {
  4.  
  5. !this->listen(QHostAddress::Any,2234))
  6.  
  7. this->threadpool = new QThreadPool(this);
  8. threadpool->setMaxThreadCount(10);
  9. threadpool->setExpiryTimeout(30000);
  10.  
  11. }
  12.  
  13. Server::~Server(){
  14.  
  15. this->close();
  16.  
  17. }
  18.  
  19. void Server::incomingConnection(int handle){
  20.  
  21. Client * client = new Client();
  22. klient->setAutoDelete(false);
  23.  
  24. client->setSocketDescriptor(handle);
  25. this->threadpool->tryStart(client);
  26.  
  27.  
  28. }
  29.  
  30. Client class:
  31.  
  32. void Client::run(){
  33. connect(this,SIGNAL(readyRead()),this,SLOT(readData()));
  34.  
  35.  
  36. }
  37.  
  38.  
  39. void Client::readData(){
  40.  
  41. //reading and sending forward to all objects of this class
  42.  
  43. }
To copy to clipboard, switch view to plain text mode 

Is it possible and a good solution to create a static member QList<Client*> and iterate inside the
readyread funcion to gaina all objects of that class and post an event? SOmething like that:

Qt Code:
  1. void Client::readData(){
  2.  
  3. Client * tmp = iterating QList<Client*>
  4. {
  5. QCoreApplication::postEvent(tmp,NewMyEvent(message));
  6.  
  7. }
To copy to clipboard, switch view to plain text mode 


}