Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. AnimatedImage load source from memory?
Forum Update on Monday, May 27th 2025

AnimatedImage load source from memory?

Scheduled Pinned Locked Moved Solved QML and Qt Quick
3 Posts 2 Posters 208 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.
  • T Offline
    T Offline
    Tummon
    wrote on 23 Feb 2023, 12:55 last edited by Tummon
    #1

    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!

    J 1 Reply Last reply 25 Feb 2023, 05:15
    0
    • T Tummon
      23 Feb 2023, 12:55

      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!

      J Offline
      J Offline
      jeremy_k
      wrote on 25 Feb 2023, 05:15 last edited by
      #2

      @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().

      Asking a question about code? http://eel.is/iso-c++/testcase/

      T 1 Reply Last reply 13 Jul 2023, 15:33
      1
      • J jeremy_k
        25 Feb 2023, 05:15

        @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 Offline
        T Offline
        Tummon
        wrote on 13 Jul 2023, 15:33 last edited by
        #3

        @jeremy_k don't know how I missed the notification for this, we have some other workaround in place but need to give this a try, thank you!

        1 Reply Last reply
        0
        • T Tummon has marked this topic as solved on 13 Jul 2023, 15:37

        • Login

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