Please don't use pointers there.
You don't even have to create a QPixmap
object and then use that to create a QIcon
object. QIcon has a constructor that takes a file name as a parameter. But that's up to you. Also check your resource location. It looks like it should be :/images/images/logo.png
QPixmap pix(":/images/images/logo.png");
QIcon icon(pix);
ui->pushButton->setIcon(icon);
ui->pushButton->setIconSize(pix.size())