Home > other >  QTableWidget adding in the insert row errors (including code)
QTableWidget adding in the insert row errors (including code)

Time:10-05

QTableWidget adding in the insert row errors: : : QTableWidget: always insert an item that is already owned by another QTableWidget copy code//add data void TableWidget: : addRow (QStringList & amp; RowList) {if (rowList isEmpty ()) return; GlobalStatus. Insert (rowList. ConstFirst (), 0).//record the newly added array name and initial state grid_data_list. Append (rowList);//logBrowser: : setLogText (QString: : number (this - & gt; RowCount ())); For (int m_row=this - & gt; RowCount (); M_row & lt; Grid_data_list. The size (); + + m_row) {this - & gt; InsertRow (m_row); This - & gt; SetItem (m_row, 0, new QTableWidgetItem (relIcon (extName), grid_data_list. Ats (m_row) at (0))); For (int m_column=1; M_column & lt; This - & gt; ColumnCount (); + + m_column) {if (m_column & lt; This - & gt; ColumnCount ()) this - & gt; SetItem (m_row, m_column, new QTableWidgetItem (grid_data_list) at (m_row)) at (m_column)));//logBrowser: : setLogText (QString (" % 1: % 2 "). Arg (m_row). Arg (m_column)); }}} what is the problem?

CodePudding user response:

https://stackoverflow.com/questions/29195237/qt-problems-adding-table-widget-items
  • Related