Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. question about path
Qt 6.11 is out! See what's new in the release blog

question about path

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 3 Posters 1.4k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • AlbatorA Offline
    AlbatorA Offline
    Albator
    wrote on last edited by
    #1

    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 :)

    1 Reply Last reply
    0
    • David_001D Offline
      David_001D Offline
      David_001
      wrote on last edited by David_001
      #2
      This post is deleted!
      1 Reply Last reply
      0
      • VRoninV Offline
        VRoninV Offline
        VRonin
        wrote on last edited by VRonin
        #3

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

        "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
        ~Napoleon Bonaparte

        On a crusade to banish setIndexWidget() from the holy land of Qt

        AlbatorA 1 Reply Last reply
        2
        • VRoninV VRonin

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

          AlbatorA Offline
          AlbatorA Offline
          Albator
          wrote on last edited by
          #4

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

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved