Then your incoming format is maybe not RGB.
Create a QImage and set every pixel with setPixel().