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. QCache for QSharedData
Forum Updated to NodeBB v4.3 + New Features

QCache for QSharedData

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 948 Views 1 Watching
  • 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.
  • O Offline
    O Offline
    overquill
    wrote on last edited by
    #1

    Hi,
    I want to load some objects from a database, and I want to use lazy loading for object members.
    So I implemented the members by using QSharedDataPointer, and now, while implementing the loader, stumbled upon QCache.

    Is there a cache that does only free elements that have their reference count decreased to zero (aside from their reference in the cache), and holds all other objects (as their data is in use in the memory anyway)?

    I think this is a very common scenario when using sql-databases, but I did not find any ready-to-use solution in the forums. Do I have to implement this by myself including reference counting, or can I at least somehow overload a QShared*-class to insert or remove itself from the associated cache?

    edit
    I guess I was looking for QWeakPointer... problem solved.

    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