您的当前位置:首页正文

qml截图

2024-12-01 来源:个人技术集锦
    CQLPushButton {
        id: button5
        x: 4
        y: 201
        width: 190
        height: 90
        m_text: qsTr("导出jpg")
        onClickedSignal: {
            fds.open();
        }
    }

    FileDialog {
        id:fds
        title: "选择保存文件路径"
        folder: shortcuts.desktop
        selectExisting: true
        selectFolder: true
        selectMultiple: false
        onAccepted: {
            rectangle.grabToImage(function(result) {
                var path = fds.fileUrl + "/aa.jpg";
                var path1 = path.substring(8,path.length);
                console.log(path1);
                result.saveToFile( path1);
            });
        }
    }
显示全文