[Development] Removing the global static QObject from QPixmapCache

Konstantin Shegunov kshegunov at gmail.com
Sun May 30 14:11:52 CEST 2021


On Sun, May 30, 2021 at 2:05 PM Giuseppe D'Angelo via Development <
development at qt-project.org> wrote:

> I'd tend to agree with idea, but not with the specific solution. You may
> want
>
> 1) to keep the cache alive across multiple QGA::exec() invocations,
> 2) to destroy it only when QGA gets destroyed,
> 3) to recreate it if QGA itself gets recreated.
>

Fair enough. If the object doesn't expect QGA to be alive while cleaning
up, then we could probably simply attach a destruction callback
(qAddPostRoutine)?


> A very simple solution is to make the cache a member of QGA(P), create
> it lazily if needed (like Q_G_S does; but I've got the funny feeling
> that the pixmap cache is used in 100% Qt apps, so maybe that's not even
> needed), and kill it in ~QGA.
>

That should work, but it'd be one of them "exceptions", wouldn't it ...? ;)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20210530/fdd06780/attachment.html>


More information about the Development mailing list