title: QFile::copy static function not copying file
body: <p>I want to copy a text file with <code>QFile</code> with this code:</p>
  
  <pre><code>void MainWindow::on_pushButton_4_clicked()
  {
      QFile::copy("C:/p/text.txt", "C:/p/text1.txt");
  }
  </code></pre>
  
  <p>I get no errors when I build it, but when I run the program, nothing happens.</p>
  
  <p>Here's the complete source code:</p>
  
  <pre><code>#include "mainwindow.h"
  #include "ui_mainwindow.h"
  #include &lt;QfileDialog&gt;
  #include &lt;QFile&gt;
  
  MainWindow::MainWindow(QWidget *parent) :
      QMainWindow(parent),
      ui(new Ui::MainWindow)
  {
      ui-&gt;setupUi(this);
  }
  
  MainWindow::~MainWindow()
  {
      delete ui;
  }
  
  int currentIndex = 0;
  
  void MainWindow::on_pushButton_2_clicked()
  {
      ui-&gt;lineEdit-&gt;setText(QFileDialog::getExistingDirectory());
  }
  
  void MainWindow::on_pushButton_clicked()
  {
      currentIndex ++;
      ui-&gt;stackedWidget-&gt;setCurrentIndex(currentIndex);
  }
  
  void MainWindow::on_pushButton_3_clicked()
  {
      currentIndex --;
      if(currentIndex &lt; 0)
      {
          currentIndex ++;
      }
      ui-&gt;stackedWidget-&gt;setCurrentIndex(currentIndex);
  }
  
  void MainWindow::on_pushButton_4_clicked()
  {
      QFile::copy("C:/p/text.txt", "C:/p/text1.txt");
  }
  </code></pre>
  
  <p>What could cause this strange behaviour?</p>