QWebEngineView html images not displaying



  • (First use of QWebEngineView) After porting our Qt Widgets Windows desktop app to use QWebEngineView instead of QWebView for embedded help, the jpeg images are not displaying but everything else is looks good. Am I forgetting something?

    images sit here:
    C:\riverware\staff\rob2n\riverware-source\EngrObjs\debug\embeddedHelp\rplFuncImages

    0_1565048158609_e298f859-da17-442a-81bc-3f9e5411da76-image.png

    looks like this
    0_1565048242966_f8f23484-475c-4c1c-bafa-d6198d7c0f3e-image.png

    baseUrl:
    file:///riverware/staff/rob2n/riverware-source/EngrObjs/debug/embeddedHelp/RplFunctionDoc.html

    html includes the following:
    <td colspan="2">
    <p>
    <div style="width:10px;">
    <img style="overflow:show;" id="imageAvgObjectsAggregatedOverTime" class="RplFunc_Image" alt="AvgObjectsAggregatedOverTime.jpg" src="rplFuncImages/AvgObjectsAggregatedOverTime.jpg"/>
    </div>
    </p>
    </td>

    line 'o code:
    _ui._predefinedWebView->setHtml (htmlBytes, baseUrl);

    screenshot:
    0_1564781202409_8c12e908-28f5-4ad4-99bf-92b0549fabdb-image.png



  • Hey everyone. I had to remove the setScheme() left over from the QWebView code. Then, voila, it worked fine.

    from:
    _rplFuncDocBaseUrl = QUrl (embedHelpPath);
    _rplFuncDocBaseUrl.setScheme ("file");

    to:
    _rplFuncDocBaseUrl = QUrl (embedHelpPath);


Log in to reply
 

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