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 not displaying my generated pages
Qt 6.11 is out! See what's new in the release blog

QWebEngineView not displaying my generated pages

Scheduled Pinned Locked Moved Solved QtWebEngine
2 Posts 1 Posters 128 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.
  • J Offline
    J Offline
    Jennise Hall
    wrote last edited by
    #1

    I'm trying to add a dialog that displays web pages generated by my application. I'm getting the bad character icons. The websites I've tested work. (However, one site's cookie warning has the same problem.) This webpage displays properly in QTextBrowser and in my web browsers but not in the QWebEngineView. My thought is I am doing something in my html code that the QWebEngineView doesn't like, but after viewing several HTML documents I'm not seeing why QWebEngineView isn't displaying a simple text string. Any ideas?

    I've created a tiny app that reproduces the issue.

    The problem:
    387e0074-4aa6-4c45-9abb-dab1eceab594-image.png

    The code example:

    #include <QApplication>
    #include <QMainWindow>
    #include <QWebEngineView>
    
    int main(int argc, char *argv[])
    {
        QApplication a(argc, argv);
        QMainWindow mw;
        QWebEngineView *view = new QWebEngineView();
        // The following works as expected.
        // view->load(QUrl("https://forum.qt.io"));
    
        view->load(QUrl("file:///Users/prplchkj/myProjects/SmWebEngineTest/TestWebpage.html"));
    
        mw.setCentralWidget(view);
        mw.show();
        return a.exec();
    }
    

    The contents of the test webpage:

    <!DOCTYPE HTML>
    <html lang="en-US">
      <head>
        <title>Debugging Web Page</title>
        <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
    
      </head>
      <body>
        <br>
        <br>
        <br>
        Hello this is a test<br>
      </body>
    </html>
    
    1 Reply Last reply
    0
    • J Offline
      J Offline
      Jennise Hall
      wrote last edited by
      #2

      Finally got my 6.11 installation working.
      This was fixed in the update.

      1 Reply Last reply
      0
      • J Jennise Hall has marked this topic as solved

      • Login

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