A request for populating a dialog with available sources for screen capturing. 更多...
| import 语句: |
import QtWebEngine
|
| Since: | Qt 6.7 |
| 在 C++: | QWebEngineDesktopMediaRequest |
To allow web applications to capture contents of a display, applications must connect to WebEngineView::desktopMediaRequested , which takes a WebEngineDesktopMediaRequest instance as an argument.
If a web application requests access to the contents of a display, WebEngineView::desktopMediaRequested will be emitted with a WebEngineDesktopMediaRequest instance as an argument which holds references to ListModels for available windows and screens that can be captured.
The data model's DisplayRole specifies the name of the source which is the title of a window or the number of the display. The model is dynamically updated if the available list of sources has changed; e.g when a window is opened/closed.
The signal handler needs to then either call selectScreen () 或 selectWindow () to accept the request and start screensharing.
另请参阅 WebEngineView::desktopMediaRequested .
|
screensModel
:
ListModel
|
A ListModel containing a list of available screens.
另请参阅 windowsModel .
|
windowsModel
:
ListModel
|
A ListModel containing a list of available windows.
另请参阅 screensModel .
|
void cancel () |
Rejects a request. Screen capturing will be aborted.
|
void selectScreen ( QModelIndex index ) |
Selects the screen at the index to be captured.
另请参阅 WebEngineDesktopMediaRequest::selectWindow ().
|
void selectWindow ( QModelIndex index ) |
Selects the window at the index to be captured.