Stanfillirenfro
26th April 2014, 20:31
Hello!
I am facing the problem of importing my graph.
In the constructor of my window, I have the following code:
ui->customPlot->saveJpg(graphSName, 520, 520);
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:
void myMainwindow::save()
{
QString graphSName = QFileDialog::getSaveFileName(this, "Information", "Save", "Picture (*.jpg *.pdf. *png)");
saveGraph->setText(graphSName);
if(!graphSName.isEmpty())
{
saveGraphHere(graphSName);
}
}
void myMainWindow::saveGraphHere(QString &graphSName)
{
ui->customPlot->saveJpg(graphSName, 520, 520);
}
My connect is in the constructor of my MainWindow and as followed:
connect(saveButton, SIGNAL(clicked()), this, SLOT(save()));
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!
I am facing the problem of importing my graph.
In the constructor of my window, I have the following code:
ui->customPlot->saveJpg(graphSName, 520, 520);
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:
void myMainwindow::save()
{
QString graphSName = QFileDialog::getSaveFileName(this, "Information", "Save", "Picture (*.jpg *.pdf. *png)");
saveGraph->setText(graphSName);
if(!graphSName.isEmpty())
{
saveGraphHere(graphSName);
}
}
void myMainWindow::saveGraphHere(QString &graphSName)
{
ui->customPlot->saveJpg(graphSName, 520, 520);
}
My connect is in the constructor of my MainWindow and as followed:
connect(saveButton, SIGNAL(clicked()), this, SLOT(save()));
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!