ButtHMI.qml 1.1 KB

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