Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

question about path



  • Hello,
    I have a little question,

    On my app i use absolut path for load a picture

    QPixmap pix("E:/deployment/repix/"+name_pic+number_pic+".png");
    

    but i would like to use a path that would allow the file to be found only from :

    "deployment/repix/"+name_pic+number_pic+".png"
    

    because the application once deployed will not necessarily have the path :E but can be :C/users with random users.

    Only this part of the path will remain unchanged :

    "deployment/repix/"+name_pic+number_pic+".png"
    

    if you have a tip it's very cool :)



  • This post is deleted!


  • QCoreApplication::applicationDirPath()+ QStringLiteral("deployment/repix/")+name_pic+number_pic+ QStringLiteral(".png");



  • @VRonin yeah great super efficace !
    thanks you, lean and simple you are wonderfull :)


Log in to reply