- Qt 6.12
- Qt WebEngine
- C++ Classes
- QtWebEngineCore
- QWebEngineNavigationRequest
- Qt 6.12.0 Reference Documentation

# QWebEngineNavigationRequest Class

A utility type for the QWebEnginePage::navigationRequested signal. More...

Header: | `#include <QWebEngineNavigationRequest>`
CMake: | `find_package(Qt6 REQUIRED COMPONENTS WebEngineCore)` `target_link_libraries(mytarget PRIVATE Qt6::WebEngineCore)`
qmake: | `QT += webenginecore`
Since: | Qt 6.2
In QML: | WebEngineNavigationRequest
Inherits: | QObject

- List of all members, including inherited members

## Properties

`(since 6.8)` hasFormData : const bool isMainFrame : const bool navigationType : const NavigationType | url : const QUrl `(since 6.12)` userInitiated : const bool

## Public Functions

void | accept()
bool | hasFormData() const
bool | isMainFrame() const
bool | isUserInitiated() const
QWebEngineNavigationRequest::NavigationType | navigationType() const
void | reject()
QUrl | url() const

## Detailed Description

Contains information about a navigation request.

To accept or reject a request, call accept() or reject().

The default if not handled is to accept the navigation.

See also QWebEnginePage::navigationRequested.

## Property Documentation

### `[read-only, since 6.8]` hasFormData : const bool

This property holds whether the navigation request contains form data

This enumeration was introduced in Qt 6.8.

Access functions:

bool | hasFormData() const

### `[read-only]` isMainFrame : const bool

This property holds whether the navigation issue is requested for a top level page.

Access functions:

bool | isMainFrame() const

### `[read-only]` navigationType : const NavigationType

This property holds the method used to navigate to a web page.

Access functions:

QWebEngineNavigationRequest::NavigationType | navigationType() const

### `[read-only]` url : const QUrl

This property holds the URL of the web page to go to.

Access functions:

QUrl | url() const

### `[read-only, since 6.12]` userInitiated : const bool

This property holds whether the navigation request was directly triggered as the result of a keyboard or mouse event.

Note: A redirect navigation that was originally triggered by a user gesture may also be reported as user-initiated.

This enumeration was introduced in Qt 6.12.

Access functions:

bool | isUserInitiated() const

## Member Function Documentation

### `[invokable]` void QWebEngineNavigationRequest::accept()

Accepts a navigation request.

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

### `[invokable]` void QWebEngineNavigationRequest::reject()

Rejects a navigation request.

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.