I have a lot of buttons that I want to set an icon to. Moreover, this icon is not the same for each button.
I do this just for one of them:
QString str=(qApp->applicationDirPath());
str.append("/pic/kb.png");
QPixmap pixmap(str);
QIcon ButtonIcon(pixmap);
ui->btnShowKB->setIcon(ButtonIcon);
ui->btnShowKB->setIconSize(pixmap.rect().size());
but I really have a lot of button (btn1,btn2,btn3,....,btn9).
How can I set other images for other buttons (/pic/1.png , /pic/2.png , /pic/3.png , .... , /pic/9.png)? Do I have to create a new QPixmap for each one, or is there a simpler solution?