Qt WebView 示例 - 迷你浏览器
Minibrowser 示例演示了如何通过Qt Quick 使用 Qt XMLWebView 模块。
Minibrowser 使用Qt Quick Controls 和 Qt XMLWebView 提供基本的浏览体验。除了用于 URL 的地址栏外,它还有几个用于浏览浏览历史记录的控件。
注意: 使用 Qt XMLWebView 模块时,必须在创建QGuiApplication 实例之前立即调用QtWebView::initialize() 。调用QtWebView::initialize() 将确保运行必要的预设置步骤。
QtWebView::initialize(); QGuiApplication app(argc, argv);
运行示例
要从 Qt Creator,打开Welcome 模式,并从Examples 中选择示例。更多信息,请参阅Qt Creator: 教程:构建并运行。
© 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.