Important: Please read the Qt Code of Conduct -

QWebEngine can't load localhost on Windows

  • Hello everyone!

    I'm porting old WebKit framework to the new QWebEngine
    I'm using Qt 5.6
    I need to load local webapps through localhost to bypass flash player security using QtcpServer.

    MainWindows start my tcp server with port 5052
    in My webEngineClass (webenginewidget.cpp) there is a method that open the webapp

    void WebEngineWidget::openDocument()
        QString webAppUrl = ResourceManager().getWebappsDir("videoswf/index.html").absolutePath();
        QString indexUrl = "http://localhost:5082" + webAppUrl;
        QUrl index(indexUrl);
        qInfo() << "openVideoDocument" << index;

    So on loadFinished i can call runjavascript to create my embed video swf
    This work very well on mac Osx
    output of qInfo:

    openVideoDocument QUrl("http://localhost:5082/Users/dev/build/webapps/videoswf/index.html")

    But in Windows
    qInfo() << "openVideoDocument" << index show

    qInfo() << "openVideoDocument" << QUrl("");

    Any Idea ??
    Thanks in advanced

Log in to reply