From: Development <[email protected]> On Behalf Of Scott Bloom Sent: Friday, September 26, 2025 09:29 To: Arno Rehn <[email protected]>; [email protected] Subject: Re: [Development] QWebChannel communication with QWebEngineView
From: Arno Rehn <[email protected]<mailto:[email protected]>> Sent: Friday, September 26, 2025 02:02 To: [email protected]<mailto:[email protected]> Cc: Scott Bloom <[email protected]<mailto:[email protected]>> Subject: Re: [Development] QWebChannel communication with QWebEngineView Hey Scott, On 26.09.2025 01:31, Scott Bloom wrote: I have found the webchannel examples. However, my need isn’t covered and I cant for the life extend any of the examples. The goal is to have a dialog window with a QWebEngineView widget instantiated, the application is all C++. The main page loaded will be in qrc, but loads other scripts that are also in the qrc. Is there any example out there that shows a simple WebChannel based communication between Widgets a WebEngineView? Yes, the RecipeBrowser example does just this: https://doc.qt.io/qt-6/qtwebengine-webenginewidgets-recipebrowser-example.html Note that QtWebChannel is agnostic to the concrete transport that's used. That's why none of the examples in the QtWebChannel repo interact with a webview and the actual webview-using examples are in QtWebEngine. QtWebEngine provides a specialized transport based on Chromium IPC. It's used automatically when you call QWebEnginePage::setChannel() [https://doc.qt.io/qt-6/qwebenginepage.html#setWebChannel]. Cheers, Arno Ill take a look. I really appreciate the pointer! Scott On a side note, I had asked for this back in the Qt3 days. It would be great if at the top of the examples directory, there was a document that listed every example and every Qt class used in the example. Years back I had wrote a perl script to generate it (and I remember emailing it in to Trolltech support as I was a commercial user back then). As the examples grow and grow, and technology may be used in one example, that is not really what is being highlighted in the example (As is the case here) it would be create to have a top level location to search. I googled all sorts of “QWebChannel” and “QWebEngineView” example combinations and it never pointed to this example. Scott
-- Development mailing list [email protected] https://lists.qt-project.org/listinfo/development
