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 :
Qt Code:
  1. ui.label->setPixmap(QPixmap(D:\images\img1.jpg));
To copy to clipboard, switch view to plain text mode 

Code 2:
Qt Code:
  1. QString img_path ="D:/images/img1.jpg";
  2. ui.label->setPixmap(QPixmap(img_path));
To copy to clipboard, switch view to plain text mode 

Please someone help to find the error.