I assume something is wrong with your png file. The following code:
QToolButton button;
button.setIcon(QIcon("E:/delete.png"));
button.setIconSize(QSize(256, 256));
button.show();
works fine for me (of course, E: /delete.png has a transparent background).
Make sure you keep transparency for your png.
source
share