QIcon icon; icon.addFile(":/icon/image.png");
QIcon icon; icon.addFile(":/icon/image.png", QSize(24,24));In this example, an image file named "image.png" is again added to the QIcon object using the addFile function. The path to the file is again specified using a Qt resource file. However, this time a QSize object is passed as the second argument to specify the size of the icon as 24 x 24 pixels. The package library for QIcon addFile is the Qt framework.