From the documentation:
When using QPainter on a QImage, the painting can be performed in another thread than the current GUI thread
So what you intend to do should work. Are you sure you have set up your thread correctly? Your usage of ui->label_2 looks very suspicious, do you have ui elements in your thread or do you access GUI elements from your thread? Perhaps you should show us more of your code.