Another option is to use OpenCV, which has specific functions to perform many color conversions, including bayer. Since QT support C++, you can also just use the OpenCV function "bayer2RGB", from this file: https://github.com/Itseez/opencv/blob/master/modules/imgproc/src/demosaicing.cpp