I assume that while you writing a test you already know which image you want to see. You can convert QPixmap
to QImage
and check if it contains the same image as expected:
bool same = QImage(filename) == pixmap.toImage();
It's not efficient but should be ok for testing purposes.