[Interest] Emit Signal From JavaScript

Tomasz Siekierda sierdzio at gmail.com
Thu Sep 24 13:55:50 CEST 2020


On Thu, 24 Sep 2020 at 11:54, John M. Schneiderman <jschneiderman at gog.com>
wrote:

> I have a QObject available on the JavasScript side of the Qt WebEngine.
> I can read properties, call slots, etc. However I cannot emit signals
> from the object. I cannot find documentation on how to do that, e.g.
>
> window.cppobj.signal
>
> I can of course have a slot called emitSignal, but that seems like
> unnecessary boilerplate. Is it possible to
>

I don't know if it works in WebEngine the same way as in QML, but you may
try:

window.cppobj.signal()

In QML, signals are called the same way as any other function. Which is
also true in C++, by the way ;-)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20200924/73b9a556/attachment.html>


More information about the Interest mailing list