Details
-
Task
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
None
-
None
Description
The fact that we have code for this in qquickpixmapcache.cpp (etc) at all is IMO a lame workaround for the fact that Qt does not have a virtual filesystem framework. As pointed out elsewhere, Gnome has gvfs, KDE has KIO... what do we have? well perhaps QAbstractFileEngine... not sure if that's a way forward. So we've done ad-hoc stuff like this. It doesn't make sense that Qt Quick has to concern itself with network fetching; and it doesn't make sense that we treat network-loaded images as something special, but can't necessarily load arbitrary resources without more independent work (textual content, CSS files, fonts, QML files, JSON and other data formats, 3D models, and so on). We have taken pains to use QUrl instead of QString anywhere that we might have naively wanted a "source" or "path", but often those properties still can't load anything but a local file on a mounted filesystem.
QTextDocument::resource() ought to be able to load remote resources, but we shuffle it off to the user instead, with the resourceProvider() function. Probably one of the main use cases for that is to load resources from the network.
Because QtPDF provides an QImageIOHandler and treats PDF as an image format, it works with QQuickPixmap: you can write
Image { source: "http://server/something.pdf" }
which is nice, but the architecture was partially dictated by the fact that Qt doesn't have a VFS. Some day we will stop treating PDF as an image format. We need to get the GPU to render the primitives that are found in the PDF, so it's fast and scalable and doesn't depend on pdfium's independent raster engine. And we need to do that for SVG too. But if you bypass QQuickPixmap, you lose the remote-loading feature.
There are plenty of other uses. We can't keep staying on the desktop and ignoring the web. Even on the desktop, there are many, many use cases for loading network resources. We should have been inspired by KIO and done something similar, more portable, and more naturally asynchronous, a long, long time ago.
Attachments
Issue Links
- depends on
-
QTBUG-103246 Qt should have a QIo like what KIO is. But much much better
- Open
- is required for
-
QTBUG-34253 QQuickBorderImage has no caching for .sci files.
- Open
-
QTBUG-81266 figure out whether QPixmapCache and QQuickPixmapCache can be unified
- Reported
-
QTBUG-94592 Reconsider image provider setup and ownership
- Reported
-
QTBUG-90627 Research a better PixmapCache <-> Image Provider interaction
- Open
-
QTBUG-16211 QListView should able to display rich text
- Closed
- relates to
-
QTBUG-35688 QQuickTextEdit: Make it possible to change the text document
- Open