加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
CaptureBar.qml 1.42 KB
一键复制 编辑 原始数据 按行查看 历史
世玉轩 提交于 2020-06-19 09:31 . init push myir hmi v2.0 gui
import QtQuick 2.0
Rectangle {
id: root
width: def.win_width
height: 80
color: "black"
property alias img_src: photoPreview.source
signal captureImage
signal captureVideoStart
signal captureVideoStop
Define {id: def}
CircularImage {
id: photoPreview
width: 70
height: width
// source: getImageFolder() + fileName
anchors.verticalCenter: root.verticalCenter
anchors.left: root.left
anchors.leftMargin: 5
radius: 5
}
//拍照按钮
/*
CaptureButton {
id: shotButton
anchors.centerIn: root
onCaptureImage: root.captureImage()
}
*/
//拍照和录像集成在一起的按钮
ShotButton {
id: shotButton
anchors.centerIn: root
delay: 10*1000 //10s
property bool startFlag: false
onClicked: root.captureImage()
onActivated: root.captureVideoStop()
onProgressChanged: {
if(progress > 0.1 && startFlag == false && down == true)
{
root.captureVideoStart()
startFlag = true;
}
}
onDownChanged: {
if(progress > 0.3 && down==false && progress != 1) //中途松开
{
root.captureVideoStop()
startFlag = false;
}
}
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化