Click here to Skip to main content
15,910,981 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have problem with assigning image to a label.I have tried below but it is not displaying anything.Please provide me solution


QPixmap pixmap(":/mnt/jffs2/VMS_orglogo.png");
ui->label_25->setPixmap(pixmap);
ui->label_25->setMask(pixmap.mask());
ui->label_25->show();

What I have tried:

QPixmap pixmap(":/mnt/jffs2/VMS_orglogo.png");
ui->label_25->setPixmap(pixmap);
ui->label_25->setMask(pixmap.mask());
ui->label_25->show();
Posted
Updated 16-Apr-18 4:08am

1 solution

Remove the setMask() call and ensure that the file has been loaded (exists). The latter can be done by checking for pixmap->isNull() being false.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900