look this: http://www.qtcentre.org/forum/f-qt-p...mage-7485.html
My solution is a bit different but I'm quite happy with
QIcon icon1
(":/Resources/Icon1.png");
QPixmap icon2
(":/Resources/Icon2.png");
// paints a midget of icon2 onto icon1
icon2
= icon2.
scaled(QSize(12,
12),Qt
::KeepAspectRatio, Qt
::SmoothTransformation);
painter.drawPixmap(0,pixmap.height()-icon2.height(),icon2);
ui.btnImage->setIcon(pixmap);
QIcon icon1(":/Resources/Icon1.png");
QPixmap icon2(":/Resources/Icon2.png");
QPixmap pixmap= icon1.pixmap(QSize(32,32));
// paints a midget of icon2 onto icon1
icon2 = icon2.scaled(QSize(12,12),Qt::KeepAspectRatio, Qt::SmoothTransformation);
QPainter painter(&pixmap);
painter.drawPixmap(0,pixmap.height()-icon2.height(),icon2);
ui.btnImage->setIcon(pixmap);
To copy to clipboard, switch view to plain text mode
Bookmarks