QWebEngineFullScreenRequestclass enables accepting or rejecting requests for entering and exiting the fullscreen mode. 更多 …
要允许元素 (如:视频) 以全屏模式展示,应用程序必须设置
FullScreenSupportEnabled和连接到fullScreenRequested, which takes aQWebEngineFullScreenRequestinstance as an argument.如果网页元素请求以全屏模式展示,
fullScreenRequestedwill be emitted with anQWebEngineFullScreenRequestinstance as an argument wheretoggleOn()返回true。信号处理程序然后需要调用accept()orreject().若进入全屏模式的请求被接受,请求全屏模式的元素将填充视口,但由应用程序使视图全屏或将页面移动到全屏模式视图。
同样,
fullScreenRequested会被发射当用户希望离开全屏模式 (即:透过ExitFullScreen上下文菜单动作)。在此情况下,toggleOn()will returnfalse,和信号处理程序再次需要accept()orreject()the request. If it is accepted, the applicaton needs to make sure that the global window state is restored.
PySide2.QtWebEngineWidgets.QWebEngineFullScreenRequest.
accept
(
)
¶
接受进入或退出全屏模式的请求。
PySide2.QtWebEngineWidgets.QWebEngineFullScreenRequest.
origin
(
)
¶
QUrl
返回要在全屏模式下打开的 URL。
PySide2.QtWebEngineWidgets.QWebEngineFullScreenRequest.
reject
(
)
¶
拒绝进入或退出全屏模式的请求。
PySide2.QtWebEngineWidgets.QWebEngineFullScreenRequest.
toggleOn
(
)
¶
bool
返回
true
若网页有发出进入全屏模式的请求,否则返回
false
.