QLabel is used for displaying text or an image. No user interaction functionality is provided. The visual appearance of the label can be configured in various ways, and it can be used for specifying a focus mnemonic key for another widget.
QLabel object acts as a placeholder to display non-editable text,image, or a animated GIF. It can also be used as a mnemonic key for other widgets.
In this example,
l4 have the caption containing hyperlink.
l2 is set to true. Hence, if this label is clicked, the associated URL will open in the browser.
linkHovered signal of
l4 is connected to
hovered() function. So, whenever the mouse hovers over it, the function will be executed.
QPixmap object prepares offscreen image from python.jpg file. It is displayed as label
l3 by using
Plain text, hyperlink or rich text can also be displayed in
QLabel most of the basic HTML tags are allowed. For Example :