Hi

I have very strange problem, QTcpSocket recive msg when i write something like that
Qt Code:
  1. tcpSocket->write("P\n");
To copy to clipboard, switch view to plain text mode 
but if i write something like that
Qt Code:
  1. tcpSocket->write("P"+t.toLatin1());
To copy to clipboard, switch view to plain text mode 
it dosent work
where t is QString

Sending function(server)
Qt Code:
  1. void server::Twyslijdane()
  2. {
  3. QSettings settings("Users.ini",QSettings::IniFormat);
  4. keys = settings.allKeys();
  5. for (int i = 0; i < keys.size(); i = i+2) {
  6. t = keys.at(i);
  7. t.remove(QString("/Login"), Qt::CaseInsensitive);
  8. t.remove(QString("/pass"), Qt::CaseInsensitive);
  9.  
  10.  
  11. connection->write("D"+t.toLatin1());
  12.  
  13. }
  14. }
To copy to clipboard, switch view to plain text mode 

reciving function
Qt Code:
  1. {
  2. qint64 bytes = buffer->write(tcpSocket->readAll());
  3. // go back as many bytes as we just wrote so that it can be read
  4. buffer->seek(buffer->pos() - bytes);
  5. // read only full lines, line by line
  6. while (buffer->canReadLine())
  7. {
  8. line = buffer->readLine();
  9. if(line[0] == 'D'){
  10. line.remove(0,1);
  11. dodajnicki(line);
  12. }
  13.  
  14. }
  15.  
  16.  
  17.  
  18. }
To copy to clipboard, switch view to plain text mode 

When i m sending tcpSocket->write("P"+t.toLatin1()); program dosent use
this part of code
Qt Code:
  1. while (buffer->canReadLine())
  2. {
  3. line = buffer->readLine();
  4. if(line[0] == 'D'){
  5. line.remove(0,1);
  6. dodajnicki(line);
  7. }
To copy to clipboard, switch view to plain text mode 

Best Regards