painter.drawPixmap(event.rect(), self.pixmap)

def sizeHint(self):
    return self.pixmap.size()
app = QApplication(sys.argv)
window = QWidget()
layout = QHBoxLayout(window)
button = PicButton(QPixmap('image.png'))
layout.addWidget(button)
window.show()
sys.exit(app.exec_())
how code a Image button in PyQt?