QScreenCapture#
The QScreenCapture
class is used for capturing a screen. More…
New in version 6.5.
Synopsis#
Properties#
active
- Whether the capturing is currently activeerror
- The code of the last errorerrorString
- Human readable string describing the cause of errorscreen
- The screen for capturing
Functions#
def
captureSession
()def
error
()def
errorString
()def
isActive
()def
screen
()def
setScreen
(screen)
Slots#
Signals#
def
activeChanged
(arg__1)def
errorChanged
()def
errorOccurred
(error, errorString)def
screenChanged
(arg__1)
Note
This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE
Detailed Description#
Warning
This section contains snippets that were automatically translated from C++ to Python and may contain errors.
The class captures a screen. It is managed by the QMediaCaptureSession
class where the captured view can be displayed in a window or recorded to a file.
session = QMediaCaptureSession() audioInput = QAudioInput() session.setAudioInput(input) recorder = QMediaRecorder() session.setRecorder(recorder) recorder.setQuality(QMediaRecorder.HighQuality) recorder.setOutputLocation(QUrl.fromLocalFile("test.mp3")) recorder.record()
- class PySide6.QtMultimedia.QScreenCapture([parent=None])#
- Parameters:
parent –
PySide6.QtCore.QObject
Note
Properties can be used directly when from __feature__ import true_property
is used or via accessor functions otherwise.
- property PᅟySide6.QtMultimedia.QScreenCapture.active: bool#
This property holds whether the capturing is currently active..
- Access functions:
isActive
()setActive
(active)Signal
activeChanged
(arg__1)
- property PᅟySide6.QtMultimedia.QScreenCapture.error: Error#
This property holds the code of the last error..
- Access functions:
error
()Signal
errorChanged
()
- property PᅟySide6.QtMultimedia.QScreenCapture.errorString: str#
This property holds a human readable string describing the cause of error..
- Access functions:
errorString
()Signal
errorChanged
()
- property PᅟySide6.QtMultimedia.QScreenCapture.screen: PySide6.QtGui.QScreen#
This property holds the screen for capturing..
- Access functions:
screen
()setScreen
(screen)Signal
screenChanged
(arg__1)
- PySide6.QtMultimedia.QScreenCapture.Error#
Enumerates error codes that can be signaled by the QScreenCapture
class. errorString()
provides detailed information about the error cause.
Constant
Description
QScreenCapture.NoError
No error
QScreenCapture.InternalError
Internal screen capturing driver error
QScreenCapture.CapturingNotSupported
Capturing is not supported
QScreenCapture.CaptureFailed
Capturing screen or window view failed
QScreenCapture.NotFound
Selected screen or window not found
- PySide6.QtMultimedia.QScreenCapture.activeChanged(arg__1)#
- Parameters:
arg__1 – bool
Notification signal of property active
.
- PySide6.QtMultimedia.QScreenCapture.captureSession()#
- Return type:
Returns the capture session this QScreenCapture
is connected to.
Use setScreenCapture()
to connect the camera to a session.
Getter of property error
.
- PySide6.QtMultimedia.QScreenCapture.errorChanged()#
Notification signal of property error
.
- PySide6.QtMultimedia.QScreenCapture.errorOccurred(error, errorString)#
- Parameters:
error –
Error
errorString – str
Signals when an error
occurs, along with the errorString
.
- PySide6.QtMultimedia.QScreenCapture.errorString()#
- Return type:
str
Getter of property errorString
.
- PySide6.QtMultimedia.QScreenCapture.isActive()#
- Return type:
bool
Getter of property active
.
- PySide6.QtMultimedia.QScreenCapture.screen()#
- Return type:
See also
Getter of property screen
.
- PySide6.QtMultimedia.QScreenCapture.screenChanged(arg__1)#
- Parameters:
arg__1 –
PySide6.QtGui.QScreen
Notification signal of property screen
.
- PySide6.QtMultimedia.QScreenCapture.setActive(active)#
- Parameters:
active – bool
See also
Setter of property active
.
- PySide6.QtMultimedia.QScreenCapture.setScreen(screen)#
- Parameters:
screen –
PySide6.QtGui.QScreen
See also
Setter of property screen
.
- PySide6.QtMultimedia.QScreenCapture.start()#
Starts screen capture.
- PySide6.QtMultimedia.QScreenCapture.stop()#
Stops screen capture.