Hi,

I need to set text on QTableWidgetItem with proper alignment between text , i following below , but the text does not allign properly
request to let me know what is the proper way of doing it.

Qt Code:
  1. char cstr[80];
  2. memset(cstr,' ',80*sizeof(char)); // Fill with 80 spaces
  3.  
  4. strncpy(cstr, desc[row],strlen(edesc[row])); // copy few chars into cstr , length does not exceed 40
  5. strncpy(&cstr[40],(const char *)stime,strlen(stime));
  6. strncpy(&cstr[47],"to",strlen("to"));
  7. strncpy(&cstr[51],(const char *)etime,strlen(etime));
  8. strncpy(&cstr[70], (const char *)date,strlen(date));
  9. cstr[79]='\0';
  10.  
  11. QString qstr = cstr;
  12.  
  13. item(row,1)->setText(qstr);
To copy to clipboard, switch view to plain text mode 

Thanks,