Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Hosting MSFT WebView2 browser control in a QT QWidget
Forum Updated to NodeBB v4.3 + New Features

Hosting MSFT WebView2 browser control in a QT QWidget

Scheduled Pinned Locked Moved Unsolved General and Desktop
qwidgetqt6native
1 Posts 1 Posters 553 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    seandr
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved