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. How to get the file path when it location changes
Forum Updated to NodeBB v4.3 + New Features

How to get the file path when it location changes

Scheduled Pinned Locked Moved Solved General and Desktop
8 Posts 5 Posters 490 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.
  • U Offline
    U Offline
    UG SEP
    wrote on last edited by
    #1

    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

    A 1 Reply Last reply
    0
    • Christian EhrlicherC Online
      Christian EhrlicherC Online
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      What do you mean with 'location changes' - who changes location and why?

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      U 1 Reply Last reply
      0
      • U UG SEP

        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

        A Offline
        A Offline
        AlexMaly
        wrote on last edited by AlexMaly
        #3

        @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.

        C 1 Reply Last reply
        0
        • A AlexMaly

          @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.

          C Offline
          C Offline
          ChrisW67
          wrote on last edited by
          #4

          @AlexMaly ...or remove it from the MRU list before the user gets a chance to see and select something that cannot work.

          1 Reply Last reply
          0
          • Christian EhrlicherC Christian Ehrlicher

            What do you mean with 'location changes' - who changes location and why?

            U Offline
            U Offline
            UG SEP
            wrote on last edited by
            #5

            @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

            1 Reply Last reply
            0
            • Christian EhrlicherC Online
              Christian EhrlicherC Online
              Christian Ehrlicher
              Lifetime Qt Champion
              wrote on last edited by
              #6

              But how should Qt know it when another program moves away the images? How should this work without user interaction?

              Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
              Visit the Qt Academy at https://academy.qt.io/catalog

              1 Reply Last reply
              1
              • U Offline
                U Offline
                UG SEP
                wrote on last edited by
                #7

                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...

                JonBJ 1 Reply Last reply
                0
                • U UG SEP

                  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...

                  JonBJ Offline
                  JonBJ Offline
                  JonB
                  wrote on last edited by
                  #8

                  @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.

                  1 Reply Last reply
                  1

                  • Login

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