The compiler is right. You should be using QImage.

The format is the way image data is stored internally - I doubt converting to indexed format will make you image gray - you'd have to change its palette to do that afterwards. MonoOnly would probably make you image black and white instead of grayscale. So you either need to convert to an indexed mode and then readjust the colour map (palette) or iterate over pixels and convert each of them to gray.