cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
Relative Path for image
Relative Path for image
Jun 11, 2014 at 7:09am UTC
Rockyy
(17)
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.
Jun 11, 2014 at 7:16am UTC
a k n
(325)
Then replace "D:/Others/ILoguTest/logo/logo.png" with "logo/logo.png" if your executable/project is in
ILoguTest
directory.
Last edited on
Jun 11, 2014 at 7:16am UTC
Jun 11, 2014 at 9:17am UTC
Rockyy
(17)
Thanks a k n its working..
Topic archived. No new replies allowed.