In Qt you can use rich text in QLabels:
QLabel* label = new QLabel("<img src=C:/img.png> In front of this text, theres an image");
label->show();
As expected, drawing the QLabel will show the image in front of the text.
Now I would like to gray out the image + text. Normally in Qt this is rather easy, because all you have to do is disable the widget:
label->setEnabled(false);
The problem now is that only the text gets grayed out by disabling, the image stays the same.
How to gray out an image included in a rich text?
EDIT to answer to comments below:
Exchanging the image with another gray version of it does work, though I had hoped for a generic solution. Taken from link:
<style>
#color
{
background-color: red;
}
#grayscale1
{
filter: grayscale(100%);
}
#grayscale2
{
opacity: 0.4;
filter: alpha(opacity=40);
}
</style>
<div id="color">
<div id="grayscale1">
<img src="C:/img.png" />
</div>
</div>
The red background color works (just as a test). The grayscale1/grayscale2 dont. :(