I have three tree views in my application and every view have its model which basically looks like this:

Qt Code:
  1. |
  2. |
  3. |--------Printer1
  4. | |
  5. | |------------Tray1
  6. | | |
  7. | | |----------Paper type
  8. | | |----------value
  9. | | |----------Amount
  10. | | |----------value
  11. | |
  12. | |------------Tray2
  13. | |
  14. | |----------Paper type
  15. | |----------value
  16. | |----------Amount
  17. | |----------value
  18. |
  19. |--------Printer2
  20. | |
  21. | |------------Tray1
  22. | | |
  23. | | |----------Paper type
  24. | | |----------value
  25. | | |----------Amount
  26. | | |----------value
  27. | |
  28. | |------------Tray2
  29. | |
  30. | |----------Paper type
  31. | |----------value
  32. | |----------Amount
  33. | |----------value
  34. |
  35. |--------Printer3
  36. |
  37. |------------Tray1
  38. | |
  39. | |----------Paper type
  40. | |----------value
  41. | |----------Amount
  42. | |----------value
  43. |
  44. |------------Tray2
  45. |
  46. |----------Paper type
  47. |----------value
  48. |----------Amount
  49. |----------value
To copy to clipboard, switch view to plain text mode 

I have a function which creates this empty model. Every value field is empty. I need to be able to do three things:

One: When the user chooses the type of paper he wants for a specific tray on a specific printer and the amount of paper he need I need to set the corresponding value fields.

Two: I need to reset the model, clear all values.

Three: I need to retrieve all values, for storing, printing etc.

I thought about making new model every time and copying it to the model that is associated to the view but I am not sure since model inherits QObject plus it doesn't solve my need number three. I am sure there is an answer in the documentation but so far I failed to find it. If somebody could help me save some time and tell me where to look for a class or a function to use it would really help me.

All I need is a way to set and get the value of the specific item in the model.

Thanks in advance.