PySide6.QtMultimedia.QWindowCapture

class QWindowCapture

此类用于捕获窗口。更多

PySide6.QtMultimedia.QWindowCapture 的继承图

在版本6.6中添加。

概要

属性

方法

插槽

信号

静态函数

注意

本文档可能包含从C++自动翻译到Python的代码片段。我们始终欢迎对代码片段翻译的贡献。如果您发现翻译问题,您也可以通过在我们的https:/bugreports.qt.io/projects/PYSIDE上创建工单来告知我们。

详细描述

该类捕获一个窗口。它由QMediaCaptureSession类管理,捕获的窗口可以在视频预览对象中显示或录制到文件中。

窗口捕获限制

使用 QWindowCapture 时存在以下限制:

class Error

枚举了可以由QWindowCapture类发出的错误代码。errorString()提供了关于错误原因的详细信息。

常量

描述

QWindowCapture.NoError

没有错误

QWindowCapture.InternalError

内部窗口捕获驱动程序错误

QWindowCapture.CapturingNotSupported

不支持窗口捕获

QWindowCapture.CaptureFailed

捕获窗口失败

QWindowCapture.NotFound

未找到选定的窗口

注意

当使用from __feature__ import true_property时,属性可以直接使用,否则通过访问器函数使用。

property activeᅟ: bool

此属性表示当前是否正在捕获。

另请参阅

start() stop()

Access functions:
property errorᅟ: QWindowCapture.错误

此属性保存最后一个错误的代码。

Access functions:
property errorStringᅟ: str

此属性包含一个描述错误原因的人类可读字符串。

Access functions:
property windowᅟ: QCapturableWindow

此属性保存用于捕获的窗口。

另请参阅

capturableWindows

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

父对象QObject

使用parent构造一个新的QWindowCapture对象。

activeChanged(arg__1)
Parameters:

arg__1 – 布尔值

属性 activeᅟ 的通知信号。

static capturableWindows()
Return type:

QCapturableWindow的列表

返回一个可用于捕获的QCapturableWindow对象列表。

captureSession()
Return type:

QMediaCaptureSession

error()
Return type:

错误

属性 errorᅟ 的获取器。

errorChanged()

属性 errorᅟ 的通知信号。

errorOccurred(error, errorString)
Parameters:
  • 错误Error

  • errorString – str

当发生error时发出信号,同时带有errorString

errorString()
Return type:

字符串

属性 errorStringᅟ 的获取器。

isActive()
Return type:

布尔

属性 activeᅟ 的获取器。

setActive(active)
Parameters:

active – 布尔值

另请参阅

isActive()

属性 activeᅟ 的设置器。

setWindow(window)
Parameters:

窗口QCapturableWindow

另请参阅

window()

属性 windowᅟ 的设置器。

start()

开始捕获window

这相当于将active属性设置为true。

stop()

停止捕获。

这相当于将active属性设置为false。

window()
Return type:

QCapturableWindow

另请参阅

setWindow()

属性 windowᅟ 的获取器。

windowChanged(window)
Parameters:

窗口QCapturableWindow

属性 windowᅟ 的通知信号。