Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Cache Images in Qt. In-box. Is there?
Forum Update on Tuesday, May 27th 2025

Cache Images in Qt. In-box. Is there?

Scheduled Pinned Locked Moved Solved General and Desktop
7 Posts 3 Posters 497 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.
  • B Offline
    B Offline
    bogong
    wrote on last edited by
    #1

    Hello!
    Is there any In-box solution in Qt for caching images if they downloaded by direct link via QNetwork?
    The key-word in this question "IN-BOX". How to write my own - perfectly aware. Seeking Qt in-box solution.

    J.HilkJ 1 Reply Last reply
    0
    • B bogong

      Hello!
      Is there any In-box solution in Qt for caching images if they downloaded by direct link via QNetwork?
      The key-word in this question "IN-BOX". How to write my own - perfectly aware. Seeking Qt in-box solution.

      J.HilkJ Offline
      J.HilkJ Offline
      J.Hilk
      Moderators
      wrote on last edited by
      #2

      @bogong
      there is https://doc.qt.io/qt-5/qpixmapcache.html

      Not sure if it fits your requirements, though🤷‍♂️


      Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


      Q: What's that?
      A: It's blue light.
      Q: What does it do?
      A: It turns blue.

      B 2 Replies Last reply
      1
      • J.HilkJ J.Hilk

        @bogong
        there is https://doc.qt.io/qt-5/qpixmapcache.html

        Not sure if it fits your requirements, though🤷‍♂️

        B Offline
        B Offline
        bogong
        wrote on last edited by
        #3

        @J-Hilk Is it thread-safe? Could it be used in QThread?

        jsulmJ J.HilkJ 2 Replies Last reply
        0
        • J.HilkJ J.Hilk

          @bogong
          there is https://doc.qt.io/qt-5/qpixmapcache.html

          Not sure if it fits your requirements, though🤷‍♂️

          B Offline
          B Offline
          bogong
          wrote on last edited by bogong
          #4

          @J-Hilk For the first glance it's what I am seeking for. Will try it next week.

          1 Reply Last reply
          0
          • B bogong

            @J-Hilk Is it thread-safe? Could it be used in QThread?

            jsulmJ Offline
            jsulmJ Offline
            jsulm
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @bogong said in Cache Images in Qt. In-box. Is there?:

            Is it thread-safe? Could it be used in QThread?

            From documentation: "Note: QPixmapCache is only usable from the application's main thread"

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            B 1 Reply Last reply
            3
            • B bogong

              @J-Hilk Is it thread-safe? Could it be used in QThread?

              J.HilkJ Offline
              J.HilkJ Offline
              J.Hilk
              Moderators
              wrote on last edited by
              #6

              @bogong said in Cache Images in Qt. In-box. Is there?:

              Is it thread-safe? Could it be used in QThread?

              No, usually thread safe classes are marked as such in the documentation, and I don't see that here.

              There's the base class of QPixmapChache: https://doc.qt.io/qt-5/qcache.html
              You can build a thread safe one from there, but its not quite as "IN-BOX" anymore


              Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


              Q: What's that?
              A: It's blue light.
              Q: What does it do?
              A: It turns blue.

              1 Reply Last reply
              1
              • jsulmJ jsulm

                @bogong said in Cache Images in Qt. In-box. Is there?:

                Is it thread-safe? Could it be used in QThread?

                From documentation: "Note: QPixmapCache is only usable from the application's main thread"

                B Offline
                B Offline
                bogong
                wrote on last edited by
                #7

                @jsulm It means - not an option for me to be used. Thx to all. Will do my own solution. Issue closed.

                1 Reply Last reply
                0

                • Login

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