@caotto QPixmap constructor crashes without QApplication initialization. I hope the proposed refactoring works, though I wasn't able to test it out myself.