I don't think passing a cleanup function will help to disambiguate, all those "raw data" constructors have it as the second to last argument.

You could try casting your array to one of the the two types used for the constructors' first argument.

Btw, your code doesn't make sense, you set your image data to 0 before creating the image.

Oh, and you most likely don't need to create QImage on the heap.

Cheers,
_