How to create a QPixmap from a NSImage or CGImageRef
Unsolved
3rd Party Software
-
I'm trying to do the same thing as this post: How to use SF Symbols dynamically with QIcon::fromTheme()?
The suggestion in that post – going from
NSImage
→CGImageRef
→QPixmap
– seemed like an option, butQtMac::fromCGImageRef
is now obsolete, and this blog post says there is no replacement.Does anyone have a way to get a
QPixmap
from anNSImage
in Qt6?Thanks!
-
Hi and welcome to devnet,
You can check the sources of the QtMac module to see how it is done. These helper functions were not overly complex.
-
The relevant helper function is qt_mac_toQImage. Then QPixmap::fromImage can be used to get a
QPixmap
(example).