hi all
how can i make a qlabel containing a text and an icon in the same time. I know that you can make one of them but what about twice.
thanks
hi all
how can i make a qlabel containing a text and an icon in the same time. I know that you can make one of them but what about twice.
thanks
Two ways:
1. Just use two QLabels next to each other in a QVBoxLayout
2. Use rich text for the label, e.g:
Qt Code:
lbl->setTextFormat(Qt::RichText); lbl->setText("<img src=":/myimage.png">Hello!");To copy to clipboard, switch view to plain text mode
You will need to have a resource collection set up that contains your image for (2).
Save yourself some pain. Learn C++ before learning Qt.
thanks nice solutions
Bookmarks