from qgis.PyQt.QtWidgets import QLabel my_label = QLabel("Hello, world!") my_label.show()
from qgis.PyQt.QtGui import QPixmap from qgis.PyQt.QtWidgets import QLabel my_pixmap = QPixmap("my_image.png") my_label = QLabel() my_label.setPixmap(my_pixmap) my_label.show()This example loads an image file named "my_image.png" using the QPixmap class, creates a QLabel object, sets the pixmap to be displayed using the setPixmap() method, and shows the label on the screen using the show() method. Package library: PyQt