[Interest] Qt5: Converting from a QPixmap to an NSImage on OSX

Andreas Pakulat apaku at gmx.de
Sat Nov 3 09:10:08 CET 2012


Hi,

On Sat, Nov 3, 2012 at 7:31 AM, Colin Dean <cad at cad.cx> wrote:
> When I compile against Qt 5.0.0-beta2, it errors at the line marked above.
> Looking through the Qt5 documentation, it appears that
> QPixmap::toMacCGImageRef() no longer exists. I looked through the
> documentation and verified its presence in Qt4 [1] and its absence in 5.0
> [2].
>
>
> As you can see, the code snippet here needs to take a QIcon and make it into
> an NSImage. I can obviously transform the QIcon to a QPixmap, but I'm not
> sure where to go from there. The QPixmap can be transformed to a QImage, but
> there doesn't seem to be anywhere to go from there.
>
>
> Is there another recommended way to accomplish this? Could these CGImageRef
> methods have been erroneously removed? or perhaps simply moved to another
> class?

The recommended way is apparently to wait for Qt 5.1 or to write your
own conversion function, Qt5.0 has dropped most of the
platform-specific API's and re-introduction is only planned as new
modules in Qt5.1. This mailing lists archive should have some
references to such cases.

Andreas



More information about the Interest mailing list