AnimatedImage load source from memory?
-
Hi all,
Trying to see if there is a way to load .gifs from memory when using AnimatedImage
It specifically mentions it is not compatible with QQuickImageProvider.
(I'm also restricted in the fact I cannot use the filesystem/resource system)
Has anyone any alternatives?
Would it be possible to override QNetworkAccessManager and do some custom url handling to point to the data in memory?Thanks!
-
Hi all,
Trying to see if there is a way to load .gifs from memory when using AnimatedImage
It specifically mentions it is not compatible with QQuickImageProvider.
(I'm also restricted in the fact I cannot use the filesystem/resource system)
Has anyone any alternatives?
Would it be possible to override QNetworkAccessManager and do some custom url handling to point to the data in memory?Thanks!
@Tummon said in AnimatedImage load source from memory?:
(I'm also restricted in the fact I cannot use the filesystem/resource system)
That's unfortunate, given that qrc is a glorified char array.
Has anyone any alternatives?
Would it be possible to override QNetworkAccessManager and do some custom url handling to point to the data in memory?This looks like a legitimate option.
https://codebrowser.dev/qt6/qtdeclarative/src/quick/items/qquickanimatedimage.cpp.html#364
d->reply = qmlEngine(this)->networkAccessManager()->get(req);Use QQmlEngine::setNetworkAccessManagerFactory() to install a customized QNetworkAccessManager that will recognize special URLs passed to QNetworkAccessManager::get().
-
@Tummon said in AnimatedImage load source from memory?:
(I'm also restricted in the fact I cannot use the filesystem/resource system)
That's unfortunate, given that qrc is a glorified char array.
Has anyone any alternatives?
Would it be possible to override QNetworkAccessManager and do some custom url handling to point to the data in memory?This looks like a legitimate option.
https://codebrowser.dev/qt6/qtdeclarative/src/quick/items/qquickanimatedimage.cpp.html#364
d->reply = qmlEngine(this)->networkAccessManager()->get(req);Use QQmlEngine::setNetworkAccessManagerFactory() to install a customized QNetworkAccessManager that will recognize special URLs passed to QNetworkAccessManager::get().
-
T Tummon has marked this topic as solved on