ButtHMI.qml 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import QtQuick 2.0
  2. import Qt.labs.controls 1.0
  3. import "qrc:/Globals"
  4. Item {
  5. id: buttITEM
  6. property color borderColor: Globals.customer_color_base
  7. property int borderWidth: 2
  8. property alias text: buttLABEL.text
  9. property alias color: buttLABEL.color
  10. property int buttX: 0
  11. property int buttY: 0
  12. property int buttWidth: 35
  13. property int buttHeight: 35
  14. property int borderRadius: 3
  15. signal buttPressed
  16. Rectangle {
  17. id: buttRECT
  18. x: buttX //parent.x
  19. y: buttY //parent.y
  20. width: buttWidth//buttITEM.width
  21. height: buttHeight
  22. border.color: borderColor
  23. border.width: borderWidth
  24. radius: borderRadius
  25. Label {
  26. id: buttLABEL
  27. anchors.centerIn: buttRECT
  28. font.family: "FontAwesome"
  29. font.bold: false
  30. font.pixelSize: buttHeight - borderWidth
  31. }
  32. MouseArea{
  33. anchors.fill:parent
  34. onClicked: {
  35. sysinfo.beep();
  36. buttPressed();
  37. }
  38. }
  39. }
  40. }