QBrush brush;brush.setTexture(myPixmap);QPalette palette ( myPushButton.palette() );palette.setBrush(QPalette::Window, brush);myPushButton.setPalette(palette);
QPixmap::scaled(...)
Pythonclass TestButton(QToolButton): def resizeEvent(self, event): sz = event.size() pix = QPixmap(u'2rightarrow-256.png') pixx = pix.scaled(sz, Qt.KeepAspectRatio) self.setIcon(pixx) self.setIconSize(sz) pass pass