Solved Cache Images in Qt. In-box. Is there?
-
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. -
@bogong
there is https://doc.qt.io/qt-5/qpixmapcache.htmlNot sure if it fits your requirements, though🤷♂️
-
@J-Hilk Is it thread-safe? Could it be used in QThread?
-
@J-Hilk For the first glance it's what I am seeking for. Will try it next week.
-
@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"
-
@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 -
@jsulm It means - not an option for me to be used. Thx to all. Will do my own solution. Issue closed.