How can I customize the look of a QPushButton or QToolButton to look something like elementaryos’s webpage “buttons”?

All I really want is the characteristic image position and the text on it’s side, maybe if i’m lucky i can also get a border like that, but i don’t really need the little description below the title 🙂
Can i do it only with StyleSheets, or do i have to subclass QPushButton/QAbstractButton/Something like that? I already searched everywhere but didn’t found that level of customization without things like painting something in a fixed place, which is exactly what i don’t want.
EDIT:
I really would like a solution that would get me a customizable button, not a fixed image one, something in the tracks of
MainWindowButton(QString(title), /*opt*/QString(description), QImage(icon));
There are a number of approaches that may work.
You might first consider trying to compose a solution with a normal
QPushButtonwith aQVBoxLayouton it. You could add threeQLabels; one for the title text, one for the caption text and one for the image. Some CSS could probably be used to render the background image of the button for up and down and more CSS to style the text in the two labels and position the image on the third but you would then find that the labels don’t shift down when the button is clicked.I think the best solution involves direct painting. You could do this by sub classing a
QWidgetand overriding thepaintEvent(). Render everything for the up state and shift everything over and down a bit for the down state.You could achieve this without sub classing by rendering the up and down states to a
QImageand styling a QPushbutton with them using CSS.There are a number of combinations of these approaches too.