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.

C++/QWebEngineView: How to obtain the link clicked by "right-click" + "open in new tab"?



  • In QWebEngineView: How to obtain the link clicked by "right-click" + "open in new tab"?

    Actually I've succeded to catch the action of "open in new tab" (after right-click) by doing this:

    QAction* openInNewTab = view->pageAction(QWebEnginePage::OpenLinkInNewTab);
    connect(openInNewTab, SIGNAL(triggered()), this, SLOT(on_actionNewTab_triggered()));
    

    But in my slot on_actionNewTab_triggered(), I have no possibility to know which url to load. I tried to know if there is something in the data of QAction*

    QVariant va;
    QAction* action = (QAction*)  sender();
    va = action->data();
    

    but the data (va) contains no url !


Log in to reply