由于 WebView1 与 Google 地图不兼容,如何在 Qt 中使用 WebView2 作为 ActiveX 控件

问题描述 投票:0回答:1

我目前正在开发一个 Qt 应用程序,需要集成 Google 地图。以前,我使用 WebView1 作为 ActiveX 控件,但遇到了与 Google 地图的兼容性问题。经过一番研究,我发现WebView1与最新的Google Maps API不完全兼容。

我读到,使用 Edge (Chromium) 渲染引擎的 WebView2 可能是更好的选择。但是,我不确定如何将 WebView2 作为 ActiveX 控件集成到 Qt 应用程序中。

以下是我当前设置的一些细节:

Development Environment: Qt 5.15
Target Platform: Windows 10
Current WebView: WebView1 (Internet Explorer-based)

任何人都可以提供有关如何在我的 Qt 应用程序中用 WebView2 替换 WebView1 的指导或示例吗?具体来说,我正在寻找:

How to set up WebView2 as an ActiveX control in Qt.
Any additional configurations or dependencies required for this setup.
Sample code or references to documentation that could help in this process.

我感谢您提供的任何帮助或指示。谢谢!

致以诚挚的问候,

我尝试过的:

I have installed the WebView2 runtime and the WebView2 SDK.
I have gone through the official Microsoft documentation on WebView2, but the examples provided are primarily for native Win32 applications.
I attempted to create a basic ActiveX control for WebView2 following various online tutorials, but I faced difficulties in integrating this with Qt.
I searched through Qt and WebView2 forums but found limited information on combining these technologies specifically.

我的期望:

Guidance on how to set up WebView2 as an ActiveX control in Qt.
Any additional configurations or dependencies required for this setup.
Sample code or references to documentation that could help in this process.
Best practices for embedding WebView2 in a Qt application, especially for rendering complex web content like Google Maps.

我感谢您提供的任何帮助或指示。谢谢!

致以诚挚的问候,

qt
1个回答
0
投票

经过艰苦的搜索,我得出结论,我必须使用 MSVC 编译该项目才能使用 QtWebEngine。

© www.soinside.com 2019 - 2024. All rights reserved.