在本页

QWebViewLoadingInfo Class

该类提供QWebView::loadingChanged() 信号的加载状态信息。更多

Header: #include <QWebViewLoadingInfo>
CMake: find_package(Qt6 REQUIRED COMPONENTS WebView)
target_link_libraries(mytarget PRIVATE Qt6::WebView)
qmake: QT += webview
Qt 6.11

公共类型

enum class LoadStatus { Started, Succeeded, Failed, Stopped }

属性

公共功能

QString errorString() const
QWebViewLoadingInfo::LoadStatus status() const
void swap(QWebViewLoadingInfo &other)
QUrl url() const

详细说明

QWebViewLoadingInfo 类型包含所请求 URL 的加载状态信息。

成员类型文档

enum class QWebViewLoadingInfo::LoadStatus

该枚举表示网页加载请求的加载状态。

常量说明
QWebViewLoadingInfo::LoadStatus::Started0页面正在加载。
QWebViewLoadingInfo::LoadStatus::Succeeded2页面加载成功。
QWebViewLoadingInfo::LoadStatus::Failed3页面无法加载。
QWebViewLoadingInfo::LoadStatus::Stopped1页面加载已停止。

另请参阅 QWebView::loadingChanged().

属性文档

[read-only] errorString : const QString

保存错误信息。

如果加载请求失败,则保存错误信息。

访问功能:

QString errorString() const

另请参阅 QWebView::loadingChanged().

[read-only] status : const LoadStatus

此属性表示网页加载请求的状态。

该枚举表示网页加载请求的加载状态。

访问函数:

QWebViewLoadingInfo::LoadStatus status() const

另请参阅 QWebView::loadingChanged().

[read-only] url : const QUrl

该属性包含加载请求的 URL。加载请求的 URL。

访问功能:

QUrl url() const

另请参阅 QWebView::url

成员函数文档

[noexcept] void QWebViewLoadingInfo::swap(QWebViewLoadingInfo &other)

将此加载信息与other 互换。该操作速度非常快,从未出现过故障。

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