Hello!
I am facing the problem of importing my graph.
In the constructor of my window, I have the following code:
Qt Code:
  1. ui->customPlot->saveJpg(graphSName, 520, 520);
To copy to clipboard, switch view to plain text mode 

This work perfectly, but the image is saved in the same file with my executable.
The idea is to show a path to save the graph.
I have the following code:

Qt Code:
  1. void myMainwindow::save()
  2. {
  3. QString graphSName = QFileDialog::getSaveFileName(this, "Information", "Save", "Picture (*.jpg *.pdf. *png)");
  4. saveGraph->setText(graphSName);
  5.  
  6. if(!graphSName.isEmpty())
  7. {
  8. saveGraphHere(graphSName);
  9. }
  10. }
  11.  
  12. void myMainWindow::saveGraphHere(QString &graphSName)
  13. {
  14. ui->customPlot->saveJpg(graphSName, 520, 520);
  15. }
To copy to clipboard, switch view to plain text mode 

My connect is in the constructor of my MainWindow and as followed:
Qt Code:
  1. connect(saveButton, SIGNAL(clicked()), this, SLOT(save()));
To copy to clipboard, switch view to plain text mode 

The problem is that when I clicked on the saveButton, the program just crashes down.

I would be grateful to any help.

Many thanks in advance!