Hosting MSFT WebView2 browser control in a QT QWidget
-
am hosting the WebView2 browser control on a QWidget within a C++ QT 6 application, but the control is not visible.
My steps for initializing and navigating are:
Create a subclass of QWidget to host the control
Create the environment via CreateCoreWebView2EnvironmentWithOptions
Create the controller via CreateCoreWebView2Controller, passing the HWND returned by QWidget::winId()
Set the bounds of the parent and control
Navigate to a url via IWebViewCore::Navigate
I've verified the NavigationStarted, NavigationCompleted, TitleChanged, and DOMContentLoaded events are called as expected.Spy++ shows a window called "Chrome_WidgetWin_0" (with several child windows) as a child of the QWidget.
But it's not visible.
Any ideas what's missing or wrong, or how to troubleshoot? Has anyone gotten QT and WebView2 to work?
Thanks.