WebEngineDesktopMediaRequest QML Type

请求在对话框中填充可用的屏幕捕捉源。更多

Import Statement: import QtWebEngine
Since: Qt 6.7
In C++: QWebEngineDesktopMediaRequest

属性

方法

详细说明

为使网络应用程序能够捕获显示屏的内容,应用程序必须连接到WebEngineView::desktopMediaRequested ,它将一个 WebEngineDesktopMediaRequest 实例作为参数。

如果网络应用程序请求访问显示屏的内容,WebEngineView::desktopMediaRequested ,并将 WebEngineDesktopMediaRequest 实例作为参数,该实例包含对ListModels 的引用,可用于捕获可用窗口和屏幕的内容。

数据模型的DisplayRole指定了源的名称,即窗口的标题或显示屏的编号。如果可用的源列表发生变化,例如窗口打开/关闭,该模型就会动态更新。

信号处理程序随后需要调用selectScreen() 或selectWindow() 来接受请求并开始屏幕共享。

另请参阅 WebEngineView::desktopMediaRequested

属性文档

screensModel : ListModel [read-only]

ListModel 包含可用屏幕列表。

另请参阅 windowsModel


windowsModel : ListModel [read-only]

包含可用窗口列表的ListModel

另请参阅 screensModel


方法文档

void cancel()

拒绝请求。屏幕捕捉将中止。


void selectScreen(QModelIndex index)

index 上选择要捕捉的屏幕。

另请参阅 WebEngineDesktopMediaRequest::selectWindow() 。


void selectWindow(QModelIndex index)

选择要捕捉的index 窗口。

另请参阅 WebEngineDesktopMediaRequest::selectScreen()。


© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.