[Interest] [Development] QRC based javascript source in QWebEngineView

Benjamin TERRIER b.terrier at gmail.com
Mon Sep 29 17:13:21 CEST 2025


On Sat, 27 Sept 2025 at 02:13, Scott Bloom <scott at towel42.com> wrote:
>
> js: Fetch API cannot load qrc:/pathtofile/base.json. URL scheme "qrc" is not supported.
>
> I have confirmed that the file DOES exist from the C++ QFile based world, but Im stumped trying to figure out what is going on.

Access to qrc URLs has some restrictions within Qt WebEngine.
You can change this behaviour with QWebEngineUrlScheme, see:
https://doc.qt.io/qt-6/qtwebengine-changes-qt6.html#qrc-scheme

Given your error, you should probably look into
QWebEngineUrlScheme::FetchApiAllowed

Cheers,

Benjamin


More information about the Interest mailing list