ViewPasse.qml 618 B

12345678910111213141516171819202122232425262728293031323334
  1. import QtQuick 2.7
  2. import QtMultimedia 5.12
  3. Item {
  4. width: 640
  5. height: 360
  6. Camera {
  7. id: camera
  8. imageCapture {
  9. onImageCaptured: {
  10. // Show the preview in an Image
  11. photoPreview.source = preview
  12. }
  13. }
  14. }
  15. VideoOutput {
  16. source: camera
  17. focus : visible // to receive focus and capture key events when visible
  18. anchors.fill: parent
  19. MouseArea {
  20. anchors.fill: parent;
  21. onClicked: camera.imageCapture.capture();
  22. }
  23. }
  24. Image {
  25. id: photoPreview
  26. }
  27. }