Displaying a standard icon and text in QLabel

pyqt, qlabel

Solution

`QLabel` doesn't have a `setIcon` method, but it has `setPixmap`. But if you use that to set a `QPixmap` it overrides your text. but there are a few possibilities to achieve what you want:

- use the html-capabilities of the `QLabel` to display text+image

- use two labels, one with the text and one with the image

- paint the component yourself

Problem

I want to display a standard warning icon along with some description text in `QLabel` in pyqt. `Qlabel` doesn't have `setIcon` function. So how could I do that? Any help would be appreciated.

Original source