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. Custom error page: how to check if an HTTP response with 4xx/5xx has a body, and thus an error page is not needed?
Forum Updated to NodeBB v4.3 + New Features

Custom error page: how to check if an HTTP response with 4xx/5xx has a body, and thus an error page is not needed?

Scheduled Pinned Locked Moved Unsolved QtWebEngine
1 Posts 1 Posters 244 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
    Ratchanan Srirattanamet
    wrote on last edited by
    #1

    So, we want to have a custom error page in our QML-based application. The error page should show up, among other situations, when the HTTP response is in 4xx or 5xx range and the response is empty, as otherwise we'll occlude the web content. For example, going to https://gstatic.com/nothing, despite returning 404, should show Google's returned error page instead of our own.

    Now, currently the only way to know if there's an error in loading or not is to listen to WebEngineView's loadingChanged, and then read the loadRequest argument. That variable doesn't distinguish between these 2 cases and, in QtWebEngine 5.15.3+, would just say that the page load fails. I've tried looking into both QtWebEngine 5.15 and 6.3's WebEngineView APIs, but I cannot find something that would help in this case.

    So, in case I overlooked something, is there a way to implement this in QtWebEngine?

    1 Reply Last reply
    0

    • Login

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