MaterialDialogBack.qml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. import QtQuick
  2. import QtQuick.Controls
  3. import QtQuick.Layouts
  4. Window {
  5. id: materialdialogback
  6. minimumWidth: 600
  7. maximumWidth: 600
  8. minimumHeight: 400
  9. maximumHeight: 400
  10. flags: Qt.Dialog | Qt.WindowStaysOnTopHint | Qt.FramelessWindowHint
  11. modality: Qt.ApplicationModal
  12. title: ""
  13. color: "white"
  14. visible: false
  15. ListModel {
  16. id: materialdialogback_materialbacklistModel
  17. // ListElement { rfid: "0000000000" }
  18. // ListElement { rfid: "11111111" }
  19. // ListElement { rfid: "11111111" }
  20. // ListElement { rfid: "11111111" }
  21. }
  22. Rectangle {
  23. x: 0
  24. y: 0
  25. width: parent.width
  26. height: 50 // 设置标题栏高度
  27. color: "#ffff0000" // 设置标题栏背景色
  28. Text {
  29. x: 20
  30. y: 0
  31. width: 80
  32. height: 50 // 设置标题栏高度
  33. text: "以下不属于该柜子的物资被放入"
  34. font.pixelSize: 25
  35. horizontalAlignment: Text.AlignLeft
  36. verticalAlignment: Text.AlignVCenter
  37. color: "white"
  38. }
  39. }
  40. Rectangle {
  41. x: 0
  42. y: 50
  43. width: parent.width
  44. height: 250
  45. color: "white"
  46. Rectangle {
  47. x: 0
  48. y: 0
  49. width: parent.width
  50. height: parent.height
  51. color: "#002b7ae9"
  52. GridView {
  53. x: 25
  54. y: 0
  55. width: parent.width - 50
  56. height: parent.height
  57. cellWidth: 550
  58. cellHeight: 50
  59. model: materialdialogback_materialbacklistModel
  60. delegate: Rectangle{
  61. width: 550
  62. height: 50
  63. color: "#00ffffff"
  64. Rectangle {
  65. x: 0
  66. y: 0
  67. width: 550
  68. height: 50
  69. color: "#00ffffff"
  70. Text {
  71. x: 0
  72. y: 0
  73. width: parent.width
  74. height: 50
  75. visible: true
  76. text: model.rfid
  77. font.pixelSize: 20
  78. horizontalAlignment: Text.AlignLeft
  79. verticalAlignment: Text.AlignVCenter
  80. color: "#000000"
  81. }
  82. }
  83. }
  84. }
  85. }
  86. }
  87. DialogButtonBox {
  88. id: materialdialogback_buttonBox
  89. x: 0
  90. y: 300
  91. width: parent.width
  92. height: 100
  93. // 自定义按钮
  94. Button {
  95. implicitWidth: 120
  96. implicitHeight: 50
  97. text: "关闭"
  98. background: Rectangle {
  99. color: "#055eb3"
  100. radius: 5
  101. }
  102. contentItem: Text {
  103. text: parent.text
  104. font.pixelSize: 30
  105. color: "white"
  106. horizontalAlignment: Text.AlignHCenter
  107. verticalAlignment: Text.AlignVCenter
  108. }
  109. onClicked: {
  110. materialdialogback.hide();
  111. }
  112. }
  113. }
  114. function slot_backRefresh()
  115. {
  116. mainScreen.refreshListMode();
  117. materialdialogback_materialbacklistModel.clear();
  118. var takelist = pConfig.sbackElseMaterialList;
  119. var materialname = pConfig.smaterialNameList;
  120. var materialpicture = pConfig.smaterialPictureList;
  121. for (var i = 0; i < takelist.length; i++) {
  122. materialdialogback_materialbacklistModel.append({png:materialpicture[takelist[i]], name: materialname[takelist[i]], rfid: "RFID:" + takelist[i]});
  123. }
  124. materialdialogback.visible = true;
  125. }
  126. }