KarmaItemDelegate.qml 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. import QtQuick 1.1
  2. import "../js/UIConstants.js" as Ui
  3. Item {
  4. id: root
  5. property alias title: titleText.text
  6. property alias points: karmaPoints.text
  7. property int marging: 20
  8. signal clicked
  9. signal pressAndHold
  10. height: 80
  11. //width: 500
  12. anchors.left: parent.left
  13. anchors.right: parent.right
  14. Row {
  15. id: grid
  16. spacing: 10
  17. height:parent.height
  18. anchors.left: parent.left
  19. anchors.right: parent.right
  20. Text {
  21. id: titleText
  22. font.pixelSize: Ui.FONT_LARGE
  23. width: parent.width-karmaPoints.width
  24. height: parent.height
  25. verticalAlignment: Text.AlignVCenter
  26. }
  27. Text {
  28. id: karmaPoints;
  29. font.pixelSize: Ui.FONT_LARGE
  30. width: 50
  31. height: parent.height
  32. verticalAlignment: Text.AlignVCenter
  33. }
  34. }
  35. Rectangle{
  36. anchors.top: parent.bottom
  37. color: "#8f00ff"
  38. height: 2
  39. width: parent.width
  40. }
  41. MouseArea {
  42. id: mouseArea
  43. anchors.fill: parent
  44. onClicked:{
  45. root.clicked();
  46. }
  47. onPressAndHold: root.pressAndHold()
  48. }
  49. }