1. MainView {
  2. width: units.gu(50)
  3. height: units.gu(75)
  4. property int mathPart: 1
  5. Column {
  6. spacing: units.gu(1)
  7. anchors {
  8. margins: units.gu(2)
  9. fill: parent
  10. }
  11. Label {
  12. id: labelScore
  13. text: actualValue.toString()
  14. property int actualValue: 0
  15. }
  16. Grid {
  17. id: buttonGrid
  18. columns: 3
  19. rows: 3
  20. spacing: 1
  21. Repeater{
  22. model: 9
  23. Button {
  24. text: index+1
  25. width: (buttonGrid.width - units.gu(1)) / 3 ; height: units.gu(8)
  26. color: UbuntuColors.darkGrey
  27. onClicked: labelScore.actualValue += index+1 * mathPart
  28. }
  29. }
  30. }
  31. }
  32. }