it works fine now:

Qt Code:
  1. ServerMainWindow::ServerMainWindow(QWidget* parent, const char* name)
  2. : MainWindowBase(parent, name),
  3. m_server(0)
  4. {
  5. m_clients.setAutoDelete(true);
  6.  
  7.  
  8. proc = new QProcess(this);
  9.  
  10. proc->addArgument("ipconfig");
  11. proc->addArgument("-all");
  12.  
  13.  
  14. QObject::connect(proc,SIGNAL(readyReadStdout()),this,SLOT(readFromStdout()));
  15. QObject::connect(m_start, SIGNAL(clicked()), this, SLOT(slotStartClicked()));
  16. QObject::connect(m_stop, SIGNAL(clicked()), this, SLOT(slotStopClicked()));
  17. proc->start();
  18. }
  19.  
  20. ////////////////////////////////////////////////////////////////////////////////
  21.  
  22. void ServerMainWindow::readFromStdout(){
  23. // QByteArray data = proc->readStdout();
  24. QString data = proc->readStdout();
  25. textEdit1->setText(data);
  26. sendToClients(data);
  27. }
  28. ////////////////////////////////////////////////////////////////////////////////
  29.  
  30. ServerMainWindow::~ServerMainWindow()
  31. {
  32. slotStopClicked();
  33. }
  34.  
  35. ////////////////////////////////////////////////////////////////////////////////
  36.  
  37. void ServerMainWindow::sendToClients(const QString& text)
  38. {
  39. if (text.isNull()) return;
  40.  
  41.  
  42. // iterate over all clients and send them the text
  43. QPtrDictIterator<Client> iter(m_clients);
  44. for (; iter.current() != 0; ++iter)
  45. {
  46. QSocket* sock = iter.current()->socket();
  47. QTextStream stream(sock);
  48. stream << text;
  49. }
  50. }
To copy to clipboard, switch view to plain text mode 


but still my client doesn't recive stdout from ipconfig
function sendToClients(data); should send QString to void ServerMainWindow::sendToClients(const QString& text)

is the function sendToClients(const QString& text) correct? or could be there some issue in the client application?

client function that recieves data from server app is:
Qt Code:
  1. void ClientMainWindow::slotRead()
  2. {
  3. QString text;
  4. while (m_socket->canReadLine())
  5. text += m_socket->readLine();
  6.  
  7. if (!text.isNull())
  8. appendText(text, Output);
  9. }
  10.  
  11.  
  12. where
  13.  
  14.  
  15.  
  16. void ClientMainWindow::appendText(const QString& text, Mode mode)
  17. {
  18. switch (mode)
  19. {
  20. case System:
  21. m_textEdit->setColor(Qt::blue);
  22. break;
  23.  
  24. case Error:
  25. m_textEdit->setColor(Qt::red);
  26. break;
  27.  
  28. default:
  29. m_textEdit->setColor(Qt::black);
  30. break;
  31. }
  32.  
  33. m_textEdit->append(text);
  34. }
To copy to clipboard, switch view to plain text mode