import QtQuick import QtQuick.Controls import QtQuick.Layouts Window { id: materialdialogtack minimumWidth: 600 maximumWidth: 600 minimumHeight: 400 maximumHeight: 400 flags: Qt.Dialog | Qt.WindowStaysOnTopHint | Qt.FramelessWindowHint modality: Qt.ApplicationModal title: "" color: "white" visible: false ListModel { id: materialdialogtack_materialtakelistModel // ListElement { rfid: "0000000000" } // ListElement { rfid: "11111111" } // ListElement { rfid: "11111111" } // ListElement { rfid: "11111111" } } Rectangle { x: 0 y: 0 width: parent.width height: 50 // 设置标题栏高度 color: "#ff3968e9" // 设置标题栏背景色 Text { x: 20 y: 0 width: 80 height: 50 // 设置标题栏高度 text: "以下不属于该柜子的物资被拿出" font.pixelSize: 25 horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter color: "white" } } Rectangle { x: 0 y: 50 width: parent.width height: 250 color: "white" Rectangle { x: 0 y: 0 width: parent.width height: parent.height color: "#002b7ae9" GridView { x: 25 y: 0 width: parent.width - 50 height: parent.height cellWidth: 550 cellHeight: 50 model: materialdialogtack_materialtakelistModel delegate: Rectangle{ width: 550 height: 50 color: "#00ffffff" Rectangle { x: 0 y: 0 width: 550 height: 50 color: "#00ffffff" Text { x: 0 y: 0 width: parent.width height: 50 visible: true text: model.rfid font.pixelSize: 20 horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter color: "#000000" } } } } } } DialogButtonBox { id: materialdialogtack_buttonBox x: 0 y: 300 width: parent.width height: 100 // 自定义按钮 Button { implicitWidth: 120 implicitHeight: 50 text: "关闭" background: Rectangle { color: "#055eb3" radius: 5 } contentItem: Text { text: parent.text font.pixelSize: 30 color: "white" horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter } onClicked: { materialdialogtack.hide(); } } } function slot_takeRefresh() { mainScreen.refreshListMode(); materialdialogtack_materialtakelistModel.clear(); var takelist = pConfig.stakeElseMaterialList; var materialname = pConfig.smaterialNameList; var materialpicture = pConfig.smaterialPictureList; for (var i = 0; i < takelist.length; i++) { materialdialogtack_materialtakelistModel.append({png:materialpicture[takelist[i]], name: materialname[takelist[i]], rfid: "RFID:" + takelist[i]}); } materialdialogtack.visible = true; } }