Relative Path for image

Hello All,

I am trying to add an image to my Gui by giving the absolute path of the image.But i want dynamic path for my image or relative path.
Please can any one let me know how to give relative path.

1
2
3
  QPixmap pix("D:/Others/ILoguTest/logo/logo.png");
  ui->label->setPixmap(pix);


The above code is working for me but i don't want fixed path for my image.
Then replace "D:/Others/ILoguTest/logo/logo.png" with "logo/logo.png" if your executable/project is in ILoguTest directory.
Last edited on
Thanks a k n its working..
Topic archived. No new replies allowed.