Home > Mobile >  QT how to realize the communication and information fast printing?
QT how to realize the communication and information fast printing?

Time:09-29

Recently in debugging Ethernet, which need to print the Ethernet communication information (time, IP, data length, data), but in the use of the table view to find the reality with a delay problem (data has been received but print delay, communications have to wait a long time after printing to complete), ask bosses have what good method to implement this feature?
To show the code below:
The static uint16_t row;
Uint16_t I=0;
QTableWidgetItem * Im_cell [13].
If (STR) isEmpty ())
{
QDebug () & lt; & lt;" The message the empty ";
return;
}
QTime tm_current=QTime: : currentTime ();
QString str_time=tm_current. ToString (hh: mm: ss. "z");
PTw - & gt; SetRowCount (row + 1);
QTableWidgetItem * Im_time=new QTableWidgetItem ();
Im_time - & gt; SetText (str_time);
PTw - & gt; SetItem (row, 0, Im_time);
Im_time - & gt; SetFlags (Im_time - & gt; Flags () & amp; (~ Qt: : ItemIsEditable));
for (i=0; I{
Im_cell [I]=new QTableWidgetItem ();
Im_cell [I] - & gt; SetText (STR [I]);
PTw - & gt; SetItem (row, "I + 1, Im_cell [I]);
Im_cell [I] - & gt; SetFlags (Im_cell [I] - & gt; Flags () & amp; (~ Qt: : ItemIsEditable));
}
//pTw - & gt; ResizeColumnsToContents ();//xy
PTw - & gt; ScrollToBottom ();
Row++;

CodePudding user response:

Can open a print another thread, namely form data display and print can be divided into two threads
  •  Tags:  
  • Qt
  • Related