Qt Creator

How to display an image on a QtWidget


There is a simple method to insert images such as a png file using QPixmap. I personally prefer to use a QLabel to show simple images on QWidget, particularry if there is no any other fancy requirements.
Basically you can locate the QLabel anywhere on your QWidget. You will find the pixelmap option at the text option section in your Qt Creator, right below the textFormat. When you click on the Value section you’ll find a small arrow pointing down.
Simple click on it, then choose your png file.

If you just simple want to display an image to the QWidget, I found the following option works well. You just need to insert the path of the image file right after the

member function in your main parent widget, then insert the following source code.

If you know other method to display an image on a QtWidget Please, let me know by dropping a line, I can add it to this post if it is relevant and you agree to do.