Planned maintenance has been done but it did not solve the problem. So work will continue on this and a new time for trying updates will be announced asap.

Inserting QWebEngineScript on next page run time.

  • I want that whenever a button on web-page (let's say a.html) get clicked my slot in core class i.e. (QWebChannel->registerObject("core", core);) gets called and it working very well only when I start calling WebEngineView->load(a.html).
    But if I am redirecting from B.html to A.html then slot not gets called. Fallowing is my code snippet:

    QWebEngineView *webEngine = new QWebEngineView(this);
    QWebEngineProfile *profile = new QWebEngineProfile("MyWebChannelProfile", webEngine);
    QWebEngineScript script2;
        script2.setSourceCode(createJsStringAfterLoad()); //here in this function I am creating my java script code which will call core class slot
    QWebEnginePage *myPage = new QWebEnginePage(profile, m_webEngine);
        QWebChannel *channel = new QWebChannel(myPage);
        Core *core = new Core(this);   //in this class my slot is present which I want to get called
        channel->registerObject("core", core);

    Please let me know how to insert the QWebEngineScript on next redirected page without knowing its url.