I'd like to have two rows of text, in two different fonts, on a single button. How might one go about this?
I'd like to have two rows of text, in two different fonts, on a single button. How might one go about this?
I think QPushButton doesn't support rich text formatting.
I didn't ask if it could be done, I asked how you could do it.
One way I can think of is to create a blank button with the appropriate size and color, position above that one or two labels with the desired text, and then position over that a transparent button whose "pressed" signal is routed to the "clicked" slot on the "real" button.
But that seems kind of convoluted.
I think the idea is to subclass QPushButton to enable rich text formatting in the button text like QLabel does.
QMaemo5ValueButton does almost the same what you want, you can modify its implementation:
http://qt.gitorious.org/+qt-develope...aluebutton.cpp