Two colours text in QPushButton

As s workaround you can use a label or text document to print the text you want. You should paint it to a pixmap and use the pixmap on your button : QPushButton *button = new QPushButton(this); QTextDocument Text; Text.setHtml(“<h2><i>Hello</i> “”<font color=red>Qt!</font></h2>”); QPixmap pixmap(Text.size().width(), Text.size().height()); pixmap.fill( Qt::transparent ); QPainter painter( &pixmap ); Text.drawContents(&painter, pixmap.rect()); QIcon … Read more