title: qt check if file exists in a directory, if it doesn't prompt the user for its location, then copy the file to the program working directory
body: <p>I have a program who's working directory is ~/Library/Application Support/MyApp, it looks here for the config.cfg and log files. The program needs a map file called MP512-Map.map. It looks in this directory to load it. </p>
  
  <p>When the program is first run on a new machine its likely the file is not in this location, but on the users desktop or within the .dmg that the executable is distributed in. I want a file dialog to pop up and get the location of the .map file (if its not already present in the working directory) and then I want the program to copy the file from that location to the working directory so that next time the program is run the .map file can be loaded right away from there.</p>
  
  <p>I have the following code:</p>
  
  <pre><code> QString path = QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation);
      QString desktop = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation);
      QDir dir(path);
      if (!dir.exists()) {
          dir.mkpath(".");   
      }
      QString MapPath = path+"/MP512-Map.map";
      QFile file(MapPath);
      QFile tempfile;
      if(file.exists()!=true){
          qDebug()&lt;&lt;"MAP FILE NOT FOUND.";
          QString temppath = QFileDialog::getOpenFileName(this,tr("Find Location of MP512-Map file:"),desktop,tr("Map Files (*.map)"));
          tempfile.copy(temppath,path);
          qDebug() &lt;&lt; "location" &lt;&lt; temppath;
          qDebug() &lt;&lt; "destination: " &lt;&lt; path;
      }
  </code></pre>
  
  <p>After this the read in of the map file occurs. The issue is with the copy. 
  The file does not successfully get copied over.</p>
  
  <p>The console output is showing the correct directories:</p>
  
  <pre><code>location "/Users/Mitch/Desktop/MP512-Map.map"
  destination:  "/Users/Mitch/Library/Application Support/AFE-MP-512"
  </code></pre>
  
  <p>Am I implementing the copy function correctly?</p>