Hi,
I am trying to set an image as the background of a push button with the help of following code but the image doesn't appear on the button 
QPixmap pixmap2
("/media/mmcblk0p1/Images/rec2_38x38.jpg");
ui->record->setIcon(icon2);
QPixmap pixmap2("/media/mmcblk0p1/Images/rec2_38x38.jpg");
QIcon icon2(pixmap2);
ui->record->setIcon(icon2);
To copy to clipboard, switch view to plain text mode
I checked the path of the image its correct.
I also tried putting the image to the resources file and setting it through the Style Sheet as follows:
#record
{
background-image: url(:/demo/images/rec2_38x38.jpg);
border: 1px solid #820a09;
border-radius: 10px;
}
#record:focus
{
border: 5px solid #ef0703;
border-radius: 10px;
}
#record
{
background-image: url(:/demo/images/rec2_38x38.jpg);
border: 1px solid #820a09;
border-radius: 10px;
}
#record:focus
{
border: 5px solid #ef0703;
border-radius: 10px;
}
To copy to clipboard, switch view to plain text mode
But no image in this case also. 
Don't know where's the problem.
Bookmarks