How to get the file path when it location changes
-
Hey everyone,
Well I am exploring qt then I Thought that what happens if the file path I saved had been saved and when I reopen It shows that the file not found because the file path is been changed So is there any way to get the new file path location from the file path I have(previous file path before the location changes)
Hope you all understand the problem
Thanks in advance -
What do you mean with 'location changes' - who changes location and why?
-
@UG-SEP T
If files was removed the only thing you can do it check that it is still present. For example it typically happens when user opens the recent files. He selects the file, you check that file is not there , tell user and remove this file from recent file list. -
@Christian-Ehrlicher I will try to explain to you with an example:
tech is a general manager and he has to shift all image at a particular location one of the images was used by qt application notepad now when user open that file then he/she didn't find that image because tech changes the location and the notepad has it the previous location through which it opens the image so is there any way to get the new location where the image exists or if the image had been removed then can we still use it
Hope you understand -
But how should Qt know it when another program moves away the images? How should this work without user interaction?
-
I have an idea if you like then please tell me that whatever the image user add-in file I should store them in an image folder which user can't access and if the user deletes or change its location it doesn't affect me because I have a copy of it in my image folder which user can't access...
-
@UG-SEP
There isn't really such a thing for a Qt program any more than for any other non-Qt program. Users own hard disks, not programs!However, in the case of Qt if you supply a resource like an image which your program uses you could use The Qt Resource System to embed your image into the executable. Since that is not an external file, whatever the user does it will remains as-is in your executable.