Qt QWEBview JavaScript callback

How to pass a function "pointer" from JavaScript to a slot?

in JavaScript:

function f1()
{
    alert("f1");
}
qtclass.submit(f1);

and in Qt:

public slots:
    void submit(void * ptr) 
    {
        (void)ptr;
    }

I need the "f1", function to get fired in the JavaScript from the c++, once some processing is done. Also I do not know in advance the name of the function pointer.

11
задан Mr_and_Mrs_D 10 December 2016 в 14:45
поделиться