Does anyone knows why this will work on debug mode but not on release mode?


QString outputDir = QFileDialog::getExistingDirectory(this, "Open Directory","/home",
                                                                     QFileDialog::ShowDirsOnly);


QString fileName = "graph.jpg" ;
QFile file(outputDir+"/"+fileName);


if (!file.open(QIODevice::ReadWrite))
    {
      QMessageBox::warning(0,"Erro ", " Erro openning file");

     }


if (!ui->widget->saveJpg( outputDir+"/"+fileName,  0, 0, 3.0, -1  ))
   {
      QMessageBox::warning(0,"Erro", " Erro saving image");
   }