MenuStatus.qml 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. import QtQuick 2.5
  2. import QtQuick.Controls 1.4
  3. //import Qt.labs.controls 1.0
  4. import QtQuick.Controls 2.0
  5. import QtQuick.Controls.Styles 1.3
  6. import QtGraphicalEffects 1.0
  7. import "qrc:/Globals"
  8. Item {
  9. id: item1
  10. property int buttImgBorder: 20 // in percent of parent.height defaults to 20%
  11. property double itemMargin: height * (buttImgBorder / 200.0)
  12. width: parent.width
  13. height: parent.height / 10.0
  14. x: 0
  15. y: parent.height - height
  16. Rectangle {
  17. anchors.fill: parent
  18. gradient: Gradient {
  19. // GradientStop { position: 0.0; color: "darkgray" }
  20. // GradientStop { position: 1.0; color: "black" }
  21. GradientStop { position: 0.0; color: "darkgray" }
  22. GradientStop { position: 1.0; color: "white" }
  23. }
  24. }
  25. Label {
  26. id: versHMI
  27. text: Globals.versionINFO + " : " + Globals.getActUserRoleText(Globals.actUserRole) //+
  28. //" IN: " + Globals.in1Status + Globals.in2Status + Globals.in3Status + Globals.in4Status
  29. font.pixelSize: 22
  30. anchors.left: parent.left
  31. anchors.top: parent.top
  32. anchors.topMargin: (parent.height - font.pixelSize) / 2
  33. anchors.leftMargin: 5
  34. width: parent.width * 0.25
  35. scale: paintedWidth > width ? (width / paintedWidth):1
  36. transformOrigin: Item.Left
  37. }
  38. Text {
  39. anchors.right: parent.right
  40. anchors.top: parent.top
  41. anchors.topMargin: (parent.height - font.pixelSize) / 2
  42. color: "white"
  43. text : ""
  44. font.pixelSize: 22
  45. width: parent.width * 0.6
  46. scale: paintedWidth > width ? (width / paintedWidth):1
  47. transformOrigin: Item.Left
  48. Timer {
  49. interval: 500
  50. running: true
  51. repeat: true
  52. triggeredOnStart: true
  53. onTriggered: {
  54. // parent.text = Qt.formatDateTime(new Date(),Qt.DefaultLocaleShortDate) + " ";
  55. parent.text = Qt.formatDateTime(new Date(),Qt.DefaultLocaleLongDate) + " ";
  56. }
  57. }
  58. }
  59. }