I am attempting to get a QLabel display an image and some text centered vertically with that image. I can't figure out how to do this. Most sources I've found on the internet suggest using the following code:
ui->label->setText("<img src='c:/images.jpg' style='vertical-align:middle;'> Hello");
However what I get is this. The bottom line of the text is centered near the image, but what I like to have is the middle line of the text to be centered (like so: made in ms paint). Sounds like a pretty common task yet I wasn't able to find any answer.
How can I achieve this?
QHBoxLayout
and put 2QLabel
in it : one with the picture, one with the title