forked from lubuwest/Friendiqa
45 lines
933 B
QML
45 lines
933 B
QML
import QtQuick 2.0
|
|
import QtMultimedia 5.0
|
|
import QtQuick.Controls 1.2
|
|
|
|
Item {
|
|
Rectangle {
|
|
VideoOutput {
|
|
anchors.fill: parent
|
|
source: localCamera
|
|
}
|
|
Camera {
|
|
id: localCamera
|
|
}
|
|
Button {
|
|
id: shotButton
|
|
width: 200; height: 75
|
|
text: "Take Photo"
|
|
onClicked: {
|
|
localCamera.imageCapture.capture();
|
|
} }
|
|
Connections {
|
|
target: localCamera.imageCapture
|
|
onImageSaved: {
|
|
photofile= imagePaths.append({"path": path})
|
|
listView.positionViewAtEnd(); }
|
|
}
|
|
|
|
Image {
|
|
id: photoFromCamera
|
|
anchors.fill: parent
|
|
fillMode: Image.PreserveAspectFit
|
|
source: photo
|
|
}
|
|
|
|
Button {
|
|
text: "Upload"
|
|
onClicked:{
|
|
var login=Service.readActiveConfig(db);
|
|
img.src=file;
|
|
Service.Upload(login,file)
|
|
}
|
|
}
|
|
}
|
|
}
|