GraphingWindow: add a menu option

This commit is contained in:
Brian T. Rice
2021-03-13 16:33:54 -08:00
parent 59a29e765c
commit 26df0173e8
2 changed files with 12 additions and 0 deletions
+11
View File
@@ -586,6 +586,13 @@ void GraphingWindow::removeAllGraphs()
}
}
void GraphingWindow::rescaleToData()
{
ui->graphingView->xAxis->rescale(true);
ui->graphingView->yAxis->rescale(true);
ui->graphingView->replot();
}
void GraphingWindow::toggleFollowMode()
{
followGraphEnd = !followGraphEnd;
@@ -627,6 +634,10 @@ void GraphingWindow::contextMenuRequest(QPoint pos)
}
menu->addSeparator();
menu->addAction(tr("Reset View"), this, SLOT(resetView()));
if (ui->graphingView->graphCount() > 0)
{
menu->addAction(tr("Rescale to data"), this, SLOT(rescaleToData()));
}
menu->addAction(tr("Zoom In"), this, SLOT(zoomIn()));
menu->addAction(tr("Zoom Out"), this, SLOT(zoomOut()));
}
+1
View File
@@ -63,6 +63,7 @@ private slots:
void saveSpreadsheet();
void saveDefinitions();
void loadDefinitions();
void rescaleToData();
void toggleFollowMode();
void addNewGraph();
void createGraph(GraphParams &params, bool createGraphParam = true);