Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QtWebEngine
  4. QWebEngineView html images not displaying
Forum Update on Monday, May 27th 2025

QWebEngineView html images not displaying

Scheduled Pinned Locked Moved Solved QtWebEngine
2 Posts 1 Posters 982 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Rob2n
    wrote on last edited by Rob2n
    #1

    (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

    1 Reply Last reply
    0
    • R Offline
      R Offline
      Rob2n
      wrote on last edited by Rob2n
      #2

      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);

      1 Reply Last reply
      1

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved