Search code examples
qt

How to Use WebView2 as an ActiveX Control in Qt Since WebView1 is Incompatible with Google Maps


I am currently working on a Qt application where I need to integrate Google Maps. Previously, I was using WebView1 as an ActiveX control, but I encountered compatibility issues with Google Maps. After some research, I found out that WebView1 is not fully compatible with the latest Google Maps API.

I've read that WebView2, which uses the Edge (Chromium) rendering engine, might be a better alternative. However, I am not sure how to integrate WebView2 as an ActiveX control within a Qt application.

Here are some specifics of my current setup:

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

Could anyone provide guidance or examples on how to replace WebView1 with WebView2 in my Qt application? Specifically, I am looking for:

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 appreciate any help or pointers you can provide. Thank you!

Best regards,

What I Have Tried:

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.

What I Expect:

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.

I appreciate any help or pointers you can provide. Thank you!

Best regards,


Solution

  • After hard search, i conclude that i had to compile the project using MSVC in order to use QtWebEngine.