Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

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

    General and Desktop
    3
    7
    143
    Loading More Posts
    • 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
      bogong last edited by

      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.Hilk 1 Reply Last reply Reply Quote 0
      • J.Hilk
        J.Hilk Moderators @bogong last edited by

        @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

        Qt Needs YOUR vote: https://bugreports.qt.io/browse/QTQAINFRA-4121


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

        B 2 Replies Last reply Reply Quote 1
        • B
          bogong @J.Hilk last edited by

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

          jsulm J.Hilk 2 Replies Last reply Reply Quote 0
          • B
            bogong @J.Hilk last edited by bogong

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

            1 Reply Last reply Reply Quote 0
            • jsulm
              jsulm Lifetime Qt Champion @bogong last edited by

              @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 Reply Quote 3
              • J.Hilk
                J.Hilk Moderators @bogong last edited by

                @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

                Qt Needs YOUR vote: https://bugreports.qt.io/browse/QTQAINFRA-4121


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

                1 Reply Last reply Reply Quote 1
                • B
                  bogong @jsulm last edited by

                  @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 Reply Quote 0
                  • First post
                    Last post