Update applications/citationsprediction/datasetController.ring - Better Code - Load the TableWidget rows using addList() method
@@ -46,27 +46,6 @@ class datasetController from WindowsControllerParent
}
func loadData
- nMax = len(aDataList)
- oView {
- TableWidget1.setrowcount(nMax-1)
- for t = 1 to nMax step 1 {
- nRow = t-1
- aRecord = aDataList[t]
- # check values
- for m = 1 to 4 step 1 {
- if aRecord[m] = 0 {
- aRecord[m] = ""
- }
- }
- # Add Record
- oAuthorsItem = new QTableWidgetItem(aRecord[1])
- oTitleItem = new QTableWidgetItem(aRecord[2])
- oAbstractItem = new QTableWidgetItem(aRecord[3])
- oTCItem = new QTableWidgetItem(""+aRecord[4])
- TableWidget1.setitem(nRow,1,oTitleItem)
- TableWidget1.setitem(nRow,2,oAuthorsItem)
- TableWidget1.setitem(nRow,3,oAbstractItem)
- TableWidget1.setitem(nRow,4,oTCItem)
- }
- TableWidget1.setcurrentcell(1,1)
- }
+ aRecords = aDataList
+ del(aRecords,1)
+ oView.TableWidget1.addList(aRecords)
\ No newline at end of file
