Hi,
I created a QTableWidget to illustrate the available wireless networks. The rowCount will be dynamic depending on number of networks. CellList is just text names I create before entering this loop.
My concern is using the 'new' for the QTableWidgetItem. It is possible this routine to populate the table will be called on a button press to refresh.
How or when should I delete (release) the memory?
Will QTableWidget::clearContents() accomplish this?

Qt Code:
  1. for (int i = 0; i < rowCount; i++ )
  2. {
  3. QTableWidgetItem *__essidName = new QTableWidgetItem(CellList[i][1].at(0));
  4. uiWireless->availableNetworksTable->setItem(i,0,__essidName);
  5. QTableWidgetItem *__strengthValue = new QTableWidgetItem(CellList[i][6].at(0));
  6. uiWireless->availableNetworksTable->setItem(i,1,__strengthValue);
  7. }
To copy to clipboard, switch view to plain text mode