Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
6.5.0
Description
Qt 6.5 introduced `ScreenCapture` class which should record a screen.
Check an [example](https://doc.qt.io/qt-6/qml-qtmultimedia-screencapture.html#details)
ApplicationWindow { id: root MouseArea { id: recording anchors.fill: parent property bool inProcess: false onClicked: { if (recording.inProcess) { screenCapture.active = recording.inProcess = false; recorder.stop(); } else { screenCapture.active = recording.inProcess = true; recorder.record(); } } } CaptureSession { id: captureSession screenCapture: ScreenCapture { id: screenCapture active: false // window: root <- it fails } recorder: MediaRecorder { id: recorder mediaFormat { fileFormat: MediaFormat.MPEG4 videoCodec: MediaFormat.VideoCodec.H265 } outputLocation: "desired-name.mp4" quality: MediaRecorder.HighQuality } } }
But then I wanted to capture a window, not a whole screen.
Due to documentation, `ScreenCapture` has a `window: Window` property to achieve that, but when I add
`window: root` to it, I got an error: `Cannot assign to non-existent property "window"`
The other thing with doc is `screen: bool`, but when I tried to compile it, QML says that its not a boolean.