QWebEngineFullScreenRequest Class

The QWebEngineFullScreenRequest class enables accepting or rejecting requests for entering and exiting the fullscreen mode. More...

Header: #include <QWebEngineFullScreenRequest>
qmake: QT += webenginewidgets
Since: Qt 5.6

Properties

Public Functions

void accept()
const QUrl &origin() const
void reject()
bool toggleOn() const

Detailed Description

The QWebEngineFullScreenRequest class enables accepting or rejecting requests for entering and exiting the fullscreen mode.

To allow elements such as videos to be shown in the fullscreen mode, applications must set QWebEngineSettings::FullScreenSupportEnabled and connect to QWebEnginePage::fullScreenRequested, which takes a QWebEngineFullScreenRequest instance as an argument.

If an element of a web page requests to be shown in the fullscreen mode, QWebEnginePage::fullScreenRequested will be emitted with an QWebEngineFullScreenRequest instance as an argument where toggleOn() returns true. The signal handler needs to then either call accept() or reject().

If the request to enter the fullscreen mode is accepted, the element requesting fullscreen mode will fill the viewport, but it is up to the application to make the view fullscreen or to move the page to a view that is in the fullscreen mode.

Likewise, a QWebEnginePage::fullScreenRequested will be emitted when the user wants to leave the full screen mode (that is, through the QWebEnginePage::ExitFullScreen context menu action). In this case, toggleOn() will return false, and the signal handler again needs to accept() or reject() the request. If it is accepted, the applicaton needs to make sure that the global window state is restored.

Property Documentation

origin : const QUrl

This property holds the URL to be opened in the fullscreen mode.

Access functions:

const QUrl &origin() const

toggleOn : const bool

This property holds whether the web page has issued a request to enter fullscreen mode.

Access functions:

bool toggleOn() const

Member Function Documentation

void QWebEngineFullScreenRequest::accept()

Accepts the request to enter or exit the fullscreen mode.

const QUrl &QWebEngineFullScreenRequest::origin() const

Returns the URL to be opened in the fullscreen mode.

Note: Getter function for property origin.

void QWebEngineFullScreenRequest::reject()

Rejects a request to enter or exit the fullscreen mode.

bool QWebEngineFullScreenRequest::toggleOn() const

Returns true if the web page has issued a request to enter the fullscreen mode, otherwise returns false.

Note: Getter function for property toggleOn.

© 2017 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.