class QWindowCapture#

This class is used for capturing a window. More

Inheritance diagram of PySide6.QtMultimedia.QWindowCapture

New in version 6.6.

Synopsis#

Properties#

Methods#

Slots#

Signals#

Static functions#

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#

The class captures a window. It is managed by the QMediaCaptureSession class where the captured window can be displayed in a video preview object or recorded to a file.

class Error#

Enumerates error codes that can be signaled by the QWindowCapture class. errorString() provides detailed information about the error cause.

Constant

Description

QWindowCapture.NoError

No error

QWindowCapture.InternalError

Internal window capturing driver error

QWindowCapture.CapturingNotSupported

Window capturing is not supported

QWindowCapture.CaptureFailed

Capturing window failed

QWindowCapture.NotFound

Selected window not found

Note

Properties can be used directly when from __feature__ import true_property is used or via accessor functions otherwise.

property activeᅟ: bool#

This property holds whether the capturing is currently active..

See also

start() stop()

Access functions:
property errorᅟ: QWindowCapture.Error#

This property holds the code of the last error..

Access functions:
property errorStringᅟ: str#

This property holds a human readable string describing the cause of error..

Access functions:
property windowᅟ: QCapturableWindow#

This property holds the window for capturing..

Access functions:
__init__([parent=None])#
Parameters:

parentQObject

Constructs a new QWindowCapture object with parent.

activeChanged(arg__1)#
Parameters:

arg__1 – bool

Notification signal of property activeᅟ .

static capturableWindows()#
Return type:

.list of QCapturableWindow

Returns a list of QCapturableWindow objects that is available for capturing.

captureSession()#
Return type:

QMediaCaptureSession

error()#
Return type:

Error

Getter of property errorᅟ .

errorChanged()#

Notification signal of property errorᅟ .

errorOccurred(error, errorString)#
Parameters:
  • errorError

  • errorString – str

Signals when an error occurs, along with the errorString.

errorString()#
Return type:

str

Getter of property errorStringᅟ .

isActive()#
Return type:

bool

Getter of property activeᅟ .

setActive(active)#
Parameters:

active – bool

See also

isActive()

Setter of property activeᅟ .

setWindow(window)#
Parameters:

windowQCapturableWindow

See also

window()

Setter of property windowᅟ .

start()#

Starts capturing the window .

This is equivalent to setting the active property to true.

stop()#

Stops capturing.

This is equivalent to setting the active property to false.

window()#
Return type:

QCapturableWindow

See also

setWindow()

Getter of property windowᅟ .

windowChanged(window)#
Parameters:

windowQCapturableWindow

Notification signal of property windowᅟ .