I must create a QPushButton
that contains an icon and 2 lines of text.
Ideally I should be able to put the icon either on the left side (on one design) or in the center, above the text (for another design in another view).
The 2 lines of text I need to be able to set separately (and even with different text size). Not text wrap.
I am going to subclass a QPushButton
, set a grid layout, and add the icon and 2 QLabels. Add a setText2()
and text2()
. Seems simple.
I have seen people suggesting this "just subclass xx control and add your own layout" but never with an actual non-breaking example.
My question:
What must I do to take advantage of all the built-in properties and events of the QPushButton
? What must I do to ensure I have the correct resize events, and that the icon and label I add for the first line of text are the QPushButton
's actual icon and text so that they will be applied correctly ?
I have been searching and I cannot find the drawing elements of the QPushButton (the containers for the QIcon and text) - it would help me if at least I could find those, so I can make my own layout using them.