[Development] Qml: fast-path loading of custom URLs

Josh Faust jfaust at suitabletech.com
Thu Jul 25 18:34:54 CEST 2013

> It used to be that the QQmlEngine docs said to set a custom
> QNetworkAccessmanager for intercepting file access, but this had three
> important drawbacks
> 1) You have to use a custom URL everywhere
> 2) You take the slow path when you don't actually need to

Is there any plan for allowing the fast path through custom URLs? We have
an internal system similar to qrc, which we currently have to use QNAM to

One possibility is to allow custom handlers for qrc paths, e.g.:
QResource::registerHandler("my_custom_root_directory", my_handler);

We could then use QQmlAbstractUrlInterceptor to translate custom URLs into
qrc paths. This is a bit roundabout, but would also allow things like
path-based imports to work.

Alternatively, being able to mark a NetworkReply as immediately finished
would get most of the way there. This would require changes in a lot of
loading paths that use the URL to determine if the file is local or remote.

Has something like QResource::registerHandler() been considered in the
past? Are there any drawbacks to that  approach?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20130725/1070021c/attachment.html>

More information about the Development mailing list