QUESTION: Given the platform and amount of data - what is the best method for populating model in QML that allows for the usage of delegates

I spent a couple of days researching this but have not found an answer to this.
BACKGROUND:

I'm starting a Qt project that will use three primary tables (each table has approx 23 rows, 10 columns - approx 230 data points for each table (~750 data points total).

Need direction on the best possible way to build and update these tables in c++ while allowing the usage of delegates in QML

The tables will NOT grow or shrink in size at run time (i.e. add or remove rows or columns ) but the data will be updated so any values that are painted on the screen must be updated

The 800 values (spanning 3 tables) are currently stored and manipulated in a seperate C files that uses static arrays with "get" and "set" functions

The two ways we are currently looking at are:
a) creating a list model in QML and populating data with javascript (see code example below
This method is working but we are concerned about performance issues using javascript over c++
QUESTION: Is this the best method?

b) creating a QAbstractTableModel in c++
new to this concept and am concerned that I will have to create individual get / set functions for each column. We currently have over 50 columns. (I believe these are "roles" within the QAbstractmodel )
QUESTION: Does QAbstractTableModel allow for the usage of delegates in QML, If using QAbstractmodel is the best approach, then does every column need it's own get set function?


QUESTION: Is there a third option that we are not considering?


Platform will be on an embedded system using the TI AM335 driving a 800x480 LCD (same as the beaglebone Black) and embedded linux

Here is an example of option A
Qt Code:
  1. //create instance of c++ class
  2. CrcDataQML2{
  3. id: crcClassInstance
  4. }
  5.  
  6.  
  7.  
  8. //create List Model
  9. ListModel{
  10. id: crcPointListModel
  11. }
  12.  
  13.  
  14. function setIndividualValue(columnToSet, IndexToSet, valueToSet)
  15. {
  16. crcClassInstance.setDataQML(columnToSet, IndexToSet, valueToSet);
  17. }
  18.  
  19.  
  20. //function to populate values in ListModel
  21. function getDataValues(id)
  22. {
  23. var i;
  24. var j;
  25. var k;
  26. console.log()
  27. for (i = 0; i<23; i++ )
  28. {
  29.  
  30. id.set(i,{ "setPoint":crcClassInstance.getDataQML(Global.POINT_SET_POINT,i),
  31. "currentValue":crcClassInstance.getDataQML(Global.POINT_CURRENT_VALUE,i),
  32. "engineeringUnits":crcClassInstance.getDataQML(Global.POINT_ENGINEERING_UNITS,i),
  33. "resolution":crcClassInstance.getDataQML(Global.POINT_RESOLUTION,i),
  34.  
  35. name:crcClassInstance.getQMLDataString(Global.POINT_NAME,i),
  36. "currentValueSource":crcClassInstance.getDataQML(Global.POINT_CV_ORIGIN,i),
  37. "setPointSource":crcClassInstance.getDataQML(Global.POINT_SP_ORIGIN,i),
  38. "alarmHigh":crcClassInstance.getDataQML(Global.POINT_ALARM_OVER,i),
  39. "alarmLow":crcClassInstance.getDataQML(Global.POINT_ALARM_UNDER,i),
  40. "alarmStatus":crcClassInstance.getDataQML(Global.POINT_ALARM_STATUS,i),
  41. "displayPoint":crcClassInstance.getBoolDataQML(Global.POINT_DISPLAY,i),
  42. "setPointDisplay":false,
  43. "alarmSetup":3,
  44. "currentValueOffset":crcClassInstance.getDataQML(Global.POINT_CURRENT_VALUE_OFFSET,i)
  45. });
  46. }
  47. }
  48.  
  49.  
  50. Timer{
  51. id: timerSam
  52. running: true
  53. repeat: true
  54. triggeredOnStart: true
  55. interval: 1000
  56. onTriggered: {
  57. //updates values in c++
  58. //getDataValues(crcPointListModel);
  59. testRowInsertion(crcPointListModel,"name");
  60. //sets a value in c++ equal to the current secnd value - just to prove we are able to manipulate values in c++
  61. setIndividualValue(Global.POINT_CURRENT_VALUE, 0, parseInt(Qt.formatTime(new Date(),"ss")) );
  62.  
  63. }
  64. }
To copy to clipboard, switch view to plain text mode