PressureTable.qml 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. import QtQuick 2.11
  2. import QtQuick.Controls 1.4
  3. Item {
  4. Rectangle{
  5. anchors.fill: parent
  6. anchors.margins: 10
  7. color: "gray"
  8. ListModel {
  9. id: libraryModel
  10. ListElement {
  11. title: "A Masterpiece"
  12. author: "Gabriel"
  13. }
  14. ListElement {
  15. title: "Brilliance"
  16. author: "Jens"
  17. }
  18. ListElement {
  19. title: "Outstanding"
  20. author: "Frederik"
  21. }
  22. }
  23. TableView {
  24. TableViewColumn {
  25. role: "title"
  26. title: "Title"
  27. width: 100
  28. }
  29. TableViewColumn {
  30. role: "author"
  31. title: "Author"
  32. width: 200
  33. }
  34. model: libraryModel
  35. }
  36. // ListModel {
  37. // id: libraryModel
  38. // }
  39. // TableView {
  40. // anchors.centerIn: parent
  41. // TableViewColumn {
  42. // role: "T0"
  43. // title: "T0"
  44. // width: 40
  45. // }
  46. // TableViewColumn {
  47. // role: "T1"
  48. // title: "T1"
  49. // width: 40
  50. // }
  51. // TableViewColumn {
  52. // role: "T2"
  53. // title: "T2"
  54. // width: 40
  55. // }
  56. // model: libraryModel
  57. // }
  58. // Component.onCompleted: {
  59. // var obj={}
  60. // obj.T0= "100"
  61. // obj.T1= "200"
  62. // obj.T2= "300"
  63. // libraryModel.append(obj)
  64. // }
  65. }
  66. }