QWebEngineNavigationRequest Class

QWebEnginePage::navigationRequested 信号的实用程序类型。更多

头文件: #include <QWebEngineNavigationRequest>
CMake: find_package(Qt6 REQUIRED COMPONENTS WebEngineCore)
target_link_libraries(mytarget PRIVATE Qt6::WebEngineCore)
qmake: QT += webenginecore
Qt 6.2
在 QML 中: WebEngineNavigationRequest
继承: QObject

属性

公共功能

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

信号

void actionChanged()

详细说明

包含导航请求的相关信息。

要接受或拒绝请求,请调用accept() 或reject() 。

如果未处理,默认情况下会接受导航请求。

另请参阅 QWebEnginePage::navigationRequested

属性文档

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

该属性表示导航请求是否包含表单数据

此属性在 Qt 6.8 中引入。

访问函数:

bool hasFormData() const

[read-only] isMainFrame : const bool

此属性表示是否为顶层页面请求导航问题。

访问功能:

bool isMainFrame() const

此属性包含用于导航到网页的方法。

访问功能:

QWebEngineNavigationRequest::NavigationType navigationType() const

[read-only] url : const QUrl

该属性包含要转到的网页 URL。

访问函数:

QUrl url() const

成员函数文档

[invokable] void QWebEngineNavigationRequest::accept()

接受导航请求。

注: 可通过元对象系统和 QML 调用该函数。请参阅Q_INVOKABLE

[invokable] void QWebEngineNavigationRequest::reject()

拒绝导航请求。

注: 可通过元对象系统和 QML 调用此函数。请参阅Q_INVOKABLE

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