Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
6.2.0
-
None
-
Windows 10 20H2 Build 19042.1288
-
-
1040fb6de4206dfe7f19c55de198b5db26b48d17 (qt/qtmultimedia/dev) 71466d9382e8712e6ee6167fcc3ebf61e7efb350 (qt/qtmultimedia/6.2) d6e4f86c28b28bed684b9d79fbb4598163e6c2ce (qt/qtmultimedia/6.2.1)
Description
I took the example from: https://doc.qt.io/qt-6/qml-qtmultimedia-imagecapture.html
I modified it a little bit to get it running:
import QtQuick import QtQuick.Window import QtMultimedia import QtQuick.Controls Window { width: 640 height: 720 visible: true CaptureSession { imageCapture : ImageCapture { id: imageCapture onImageCaptured: function( id, preview ){ console.log( "Image captured: >" + preview + "<" ) } } camera: Camera { id: camera } videoOutput: videoOutput } VideoOutput { id: videoOutput anchors.top: parent.top anchors.left: parent.left anchors.right: parent.right height: parent.height / 2 } Image { id: photoPreview anchors.top: videoOutput.bottom anchors.bottom: parent.bottom anchors.left: parent.left anchors.right: parent.right source: imageCapture.preview // always shows the last captured image } Button{ text: "Capture" anchors.left: parent.left anchors.bottom: parent.bottom onClicked: imageCapture.capture() } Button{ text: "Check whats in imageCapture.preview" anchors.right: parent.right anchors.bottom: parent.bottom onClicked: console.log( "imageCapture.preview >" + imageCapture.preview + "<" ) } Component.onCompleted: camera.start() }
- Open the app
- Push button "Capture"
- onImageCaptured is called with an image
- photoPreview does not show an image
- Push button "Check whats in imageCapture.preview" logs to console - imageCapture.preview seems empty
So now I am not certain if the example is just wrong or something is broken.
Also the type for preview is documented wrong (I guess):
Attachments
For Gerrit Dashboard: QTBUG-97622 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
377403,2 | Correct the preview type to string | 6.2.1 | qt/qtmultimedia | Status: MERGED | +2 | 0 |
377404,2 | Correct the preview type to string | 6.2 | qt/qtmultimedia | Status: MERGED | +2 | 0 |
377409,2 | Correct the preview type to string | dev | qt/qtmultimedia | Status: MERGED | +2 | 0 |