Why iframe triggered QWebPage::acceptNavigationRequest(url, QWebEnginePage::NavigationTypeLinkClicked, false), not QWebEnginePage::NavigationTypeTyped?



  • I am using qt5.10.1 webengine module. I encountered a weird thing that iframe triggered QWebPage::acceptNavigationRequest(url, QWebEnginePage::NavigationTypeLinkClicked, false). More detailed as follow.

    QUrl url = QUrl::fromLocalFile(":/resource/index.html");
    QWebEngineView *view = new QWebEngineView;
    QWebEnginePage *page = new QWebEnginePage;
    view->setPage(page);
    view->load(url);  
    

    QWebPage::acceptNavigationRequest is triggered as QWebEnginePage::NavigationTypeLinkClicked for its type and "www.google.com.hk" for its url then. I think QWebEnginePage::NavigationTypeTyped is the right type.

    index.html is something like

    <!DOCTYPE html>
    <html>
        <head>
        </head>
        <body>
            <textarea id="output">a test html</textarea><br/>
    		<iframe width=900, height=500, src="http://www.google.com.hk"><iframe>
        </body>
    </html>
    

    Is there something wrong with my index.hmtl? If not, why does it happen and how can I disable this trigger?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.