From c449675b00e378cf3e671d4c01e204000db48f8e Mon Sep 17 00:00:00 2001 From: Collin Kidder Date: Tue, 13 Sep 2016 10:08:47 -0400 Subject: [PATCH] Double clicking a graph's name now edits it instead of renaming it. This allows easier access to editing graphs. You can rename the graph in the edit screen if required. --- graphingwindow.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/graphingwindow.cpp b/graphingwindow.cpp index e555f0f..88a2ddf 100644 --- a/graphingwindow.cpp +++ b/graphingwindow.cpp @@ -197,12 +197,16 @@ void GraphingWindow::titleDoubleClick(QMouseEvent* event, QCPPlotTitle* title) Q_UNUSED(event) // Set the plot title by double clicking on it bool ok; + + /* QString newTitle = QInputDialog::getText(this, "SavvyCAN Graphing", "New plot title:", QLineEdit::Normal, title->text(), &ok); if (ok) { title->setText(newTitle); ui->graphingView->replot(); } + */ + editSelectedGraph(); } void GraphingWindow::axisLabelDoubleClick(QCPAxis *axis, QCPAxis::SelectablePart part) @@ -225,7 +229,7 @@ void GraphingWindow::legendDoubleClick(QCPLegend *legend, QCPAbstractLegendItem // Rename a graph by double clicking on its legend item Q_UNUSED(legend) if (item) // only react if item was clicked (user could have clicked on border padding of legend where there is no item, then item is 0) - { + {/* QCPPlottableLegendItem *plItem = qobject_cast(item); bool ok; QString newName = QInputDialog::getText(this, "SavvyCAN Graphing", "New graph name:", QLineEdit::Normal, plItem->plottable()->name(), &ok); @@ -246,7 +250,8 @@ void GraphingWindow::legendDoubleClick(QCPLegend *legend, QCPAbstractLegendItem } ui->graphingView->replot(); - } + } */ + editSelectedGraph(); } }