可以把 QML 类型导入应用程序,使用以下 import 语句在 .qml 文件:
#include <QtWebEngineQuick>
要链接到采用 qmake 构建的模块,添加以下 QT 变量到 qmake .pro 文件:
QT += webenginequick
为采用 CMake 构建,使用
find_package()
命令以定位 Qt6 包中需要的模块组件和
target_link_libraries()
以链接到模块:
find_package(Qt6 COMPONENTS WebEngineQuick REQUIRED) target_link_libraries(target PRIVATE Qt::WebEngineQuick)
| AuthenticationDialogRequest | A request for providing authentication credentials required by proxies or HTTP servers |
| ColorDialogRequest | 用于通过用户选择颜色的请求 |
| ContextMenuRequest | 用于展示上下文菜单的请求 |
| FileDialogRequest | A request for letting the user choose a (new or existing) file or directory |
| FindTextResult | A utility type for encapsulating the result of a string search on a page |
| FullScreenRequest | A utility type for the WebEngineView::fullScreenRequested() signal |
| JavaScriptDialogRequest | A request for showing an alert, a confirmation, or a prompt dialog from within JavaScript to the user |
| QuotaRequest | A utility type for the WebEngineView::quotaRequested() signal |
| RegisterProtocolHandlerRequest | Type enables accepting or rejecting requests from the registerProtocolHandler API |
| TooltipRequest | A request for showing a tooltip to the user |
| WebEngine | Provides access to the default settings and profiles shared by all web engine views |
| WebEngineAction | An action that represents a WebEngineView::WebAction |
| WebEngineCertificateError | A utility type for ignoring certificate errors or rejecting erroneous certificates |
| WebEngineClientCertificateOption | Represents a client certificate option |
| WebEngineClientCertificateSelection | Provides a selection of client certificates |
| WebEngineDownloadRequest | 提供关于下载的信息 |
| WebEngineHistory | Provides data models that represent the history of a web engine page |
| WebEngineHistoryModel | A data model that represents the history of a web engine page |
| WebEngineLoadingInfo | A utility type for the WebEngineView::loadingChanged signal |
| WebEngineNavigationRequest | Represents a request for navigating to a web page as part of WebEngineView::navigationRequested() |
| WebEngineNotification | 封装 HTML5 Web 通知数据 |
| WebEngineProfile | Contains settings, scripts, and visited links common to multiple web engine views |
| WebEngineSettings | Allows configuration of browser properties and attributes |
| WebEngineView | A WebEngineView renders web content within a QML application |