However, I noticed that it didn't print it properly and it kept giving me an error saying QPixmap can't be used in a non-gui thread. This made no sense to me because I was printing a QImage which should be fine on a different thread.

I looked into the QPaintEngine, specifically drawImage(), and it turns out that it converts the image to a QPixmap and it calls drawPixmap in qpaintengine_preview.cpp.

I think the link above has the same title but not the same problem. It doesn't crash at all. It just displays "QPixmap: It is not safe to use pixmaps outside the GUI thread." message and continues on doing what it needs to (except for drawing the QImage).

I can see that QPixmap isn't thread safe so I used a QImage instead which is.

But when I make a drawImage(qImage) call in the different thread, the paintengine converts the QImage to a QPixmap and therefore won't work.