[Interest] How to make QImage aware of updated memory buffer?

David M. Cotter dave at kjams.com
Sun Sep 1 00:33:39 CEST 2024


I manually twiddle the memory returned by bits(), and i want the cacheKey to be invaliated, so it knows the image cached on the video card is stale. I want to mix QPainter calls with my manual bit-twiddles. There doesn't seem to be a way to do this.

I have way too much legacy code that does manual bit twiddling and buffer iteration for graphics ops, so it's not an option to just rewrite everything to "use QPainter calls only" on my buffers.

I saw this post:
https://stackoverflow.com/questions/55869926/qt-how-to-make-qimage-aware-of-updated-memory-buffer

but the solution offered seems like a hack, and could be a performance problem too since i think it will copy the bits from the mem buffer back to the video card every time?

Is there or will there be a sanctioned method for this?

Feel free to reply on the web forum here: 

https://forum.qt.io/topic/158492/how-to-make-qimage-aware-of-updated-memory-buffer

-davec
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20240831/12154948/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fdabc3bf-87df-44e6-90c8-11d09667ec3c.png
Type: image/png
Size: 5483 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20240831/12154948/attachment-0001.png>


More information about the Interest mailing list