This type is used for capturing a screen. More...
| Import Statement: | import QtMultimedia |
| Since: | Qt 6.5 |
| In C++: | QScreenCapture |
ScreenCapture captures a screen. It is managed by MediaCaptureSession where the captured screen can be displayed in a video preview object or recorded to a file.
The code below shows a simple capture session with ScreenCapture playing back the captured primary screen view in VideoOutput.
CaptureSession { id: captureSession screenCapture: ScreenCapture { id: screenCapture active: true } videoOutput: VideoOutput { id: videoOutput } }
On Qt 6.5.2 and above, the following limitations apply to using ScreenCapture:
QScreenCapture class. Instead, the OS will show a screen selection wizard upon invoking QScreenCapture::setActive(true). The screen
capture feature requires the installation of the ScreenCast service supported via XDG Desktop Portal and {https://pipewire.org/}{PipeWire} (0.3). These limitations might change in the future.
AndroidManifest.xml file:
<manifest ...>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PROJECTION" />
<application ...>
<service android:name="org.qtproject.qt.android.multimedia.QtScreenCaptureService"
android:foregroundServiceType="mediaProjection"
android:exported="false"/>
</service>
</application>
</manifest>
See also WindowCapture and CaptureSession.
|
active : bool |
Describes whether the capturing is currently active.
|
error : enumeration |
Returns a code of the last error.
|
errorString : string |
Returns a human readable string describing the cause of error.
|
screen : Screen |
Describes the screen for capturing.
As part of the free Business evaluation, we offer a free welcome call for companies, to talk about your requirements, and how the Felgo SDK & Services can help you. Just sign up and schedule your call.
Sign up now to start your free Business evaluation: