Ts there a way to force the QPushButton to render it's text as HTML as the QLabel does?
Ts there a way to force the QPushButton to render it's text as HTML as the QLabel does?
While you were hanging yourself on someone else's words
Dying to believe in what you heard
I was staring straight into the shining sun
I'm afraid one has to subclass QPushButton and do the HTML text handling with help of a QTextDocument.
Ideas:
- subclass QPushButton
- do not pass any text to QPushButton
- reimplement at least QWidget::sizeHint(), QWidget::minimumSizeHint() and QWidget::paintEvent()
- in paintEvent(), let the base class draw it's "empty" contents first and then let the QTextDocument draw it's content over the button
- check out the sources of QLabel in case you need tips how to implement aforementioned size hint methods
J-P Nurmi
Thanks... I was hoping to avoid that whole mess
While you were hanging yourself on someone else's words
Dying to believe in what you heard
I was staring straight into the shining sun
Bookmarks