Home > Back-end >  QTableWidget delete table rows, there is a problem
QTableWidget delete table rows, there is a problem

Time:10-27

Requirements:
Clears out originally before each load data, the data in the table, then apply colours to a drawing new content, the question now to
Every time when I am empty, gave me the line object emptied (because the table border lines was clear to all have no), I wonder, I just want to empty the contents inside the ah, that how to get ah, I'm going away, turn,!!!!!!
Here are the garbage code I wrote:
//IP list before each search equipment, clears away form data
For (int I=NetWorkInfoList. The size () - 1; i>=0; I -) {

for(int j=0; J<4. J++) {

If (UI - & gt; TableWidget - & gt; The item (I, j)! Nullptr)={

The UI - & gt; TableWidget - & gt; RemoveRow (I);

}
}
}

CodePudding user response:

https://blog.csdn.net/qq_16093323/article/details/79226349
You can take a look at this, removeRow checked the manual, this function is directly delete rows, including line and content, and tablewidget several remove function are you want to delete the object,
May also can try the UI - & gt; Tablewidget - & gt; Clearcontents () can clear all lines, does not remove the line object

CodePudding user response:

reference 1/f, a white steamed bun response:

https://blog.csdn.net/qq_16093323/article/details/79226349You can take a look at this, removeRow checked the manual, this function is directly delete rows, including line and content, and tablewidget several remove function are you want to delete the object,
May also can try the UI - & gt; Tablewidget - & gt; Clearcontents () can clear all lines, line will not remove object

Ha ha, this after I carefully looked at the manual, have to solve this problem, thank you!
  • Related