aj2903
18th February 2009, 14:45
i want to display simple image on qlabel.
My application is on C: while the images to load is on D:\images\img1.jpg
The label is made in designer .
I have tried several way to load it but is unsuccessful.
Someone Please help
Here is the code i have tried :
Code 1 :
ui.label->setPixmap(QPixmap(D:\images\img1.jpg));
Code 2:
QString img_path ="D:/images/img1.jpg";
ui.label->setPixmap(QPixmap(img_path));
Please someone help to find the error.
My application is on C: while the images to load is on D:\images\img1.jpg
The label is made in designer .
I have tried several way to load it but is unsuccessful.
Someone Please help
Here is the code i have tried :
Code 1 :
ui.label->setPixmap(QPixmap(D:\images\img1.jpg));
Code 2:
QString img_path ="D:/images/img1.jpg";
ui.label->setPixmap(QPixmap(img_path));
Please someone help to find the error.