import QtQuick import QtQuick.Controls import QtQuick.Layouts Item { id: prompt_info x: parent.width / 2 - 175 y: parent.height / 2 - 175 width: 350 height: 350 visible: false property int promptInfoTimeout: 0; property string promptInfoText: ""; property string promptInfoIcon: ""; property string promptInfoColor: ""; Connections { target: prompt_info onPromptInfoTextChanged: { prompt_info_notice.text = promptInfoText; } onPromptInfoIconChanged: { prompt_info_image.source = promptInfoIcon; } onPromptInfoColorChanged: { prompt_info_rect.color = promptInfoColor; } } Rectangle { id: prompt_info_rect anchors.fill: parent color: "#66ea3a0e" radius: 20 Column { x: 0 y: 0 width: 350 height: 350 visible: true spacing: 30 padding: 0 topPadding: 46 Image { id: prompt_info_image width: 200 height: 200 opacity: 0.5 anchors.horizontalCenter: parent.horizontalCenter source: "qrc:/png/error.png" } Label { id: prompt_info_notice width: parent.width anchors.horizontalCenter: parent.horizontalCenter color: "#9affffff" text: qsTr("") font.pixelSize: 25 horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter wrapMode: Text.WrapAnywhere font.bold: true } } } Timer { interval: 1000 running: true repeat: true onTriggered: { if(promptInfoTimeout > 0) { if (prompt_info.visible === false) { prompt_info.visible = true; } promptInfoTimeout--; } else{ prompt_info.visible = false; } } } }